mirror of
https://github.com/ansible/awx.git
synced 2026-06-28 09:58:03 -02:30
fix: pipe blob content via stdin to avoid ARG_MAX limit
The base64-encoded controller.json (~2.7MB) exceeds the OS argument length limit when passed as a command-line argument to gh api via -f "content=$(base64 ...)". This causes the blob creation step to fail with "Argument list too long". Pipe the content through base64 | jq | gh api --input - so the payload never hits the command line. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
9
.github/workflows/spec-sync-on-merge.yml
vendored
9
.github/workflows/spec-sync-on-merge.yml
vendored
@@ -147,11 +147,10 @@ jobs:
|
|||||||
# Get the tree SHA from the base commit (base_tree requires a tree SHA, not a commit SHA)
|
# Get the tree SHA from the base commit (base_tree requires a tree SHA, not a commit SHA)
|
||||||
BASE_TREE_SHA=$(gh api "repos/${SPEC_REPO}/git/commits/${BASE_SHA}" --jq '.tree.sha')
|
BASE_TREE_SHA=$(gh api "repos/${SPEC_REPO}/git/commits/${BASE_SHA}" --jq '.tree.sha')
|
||||||
|
|
||||||
# Create blob and commit via API (commits created through the API are automatically signed by GitHub)
|
# Create blob via API using --input to avoid ARG_MAX limit on large specs
|
||||||
BLOB_SHA=$(gh api "repos/${SPEC_REPO}/git/blobs" \
|
BLOB_SHA=$(base64 -w 0 controller.json | \
|
||||||
-f "content=$(base64 -w 0 controller.json)" \
|
jq -Rs '{content: ., encoding: "base64"}' | \
|
||||||
-f "encoding=base64" \
|
gh api "repos/${SPEC_REPO}/git/blobs" --input - --jq '.sha')
|
||||||
--jq '.sha')
|
|
||||||
|
|
||||||
TREE_SHA=$(gh api "repos/${SPEC_REPO}/git/trees" \
|
TREE_SHA=$(gh api "repos/${SPEC_REPO}/git/trees" \
|
||||||
-f "base_tree=${BASE_TREE_SHA}" \
|
-f "base_tree=${BASE_TREE_SHA}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user