From 6fd612a058eb6c37d6c21bbbd43fe32185dd1dc5 Mon Sep 17 00:00:00 2001 From: Rodrigo Horie Date: Wed, 17 Jun 2026 15:59:33 -0300 Subject: [PATCH] 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) --- .github/workflows/spec-sync-on-merge.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/spec-sync-on-merge.yml b/.github/workflows/spec-sync-on-merge.yml index fd62c4034f..d7ac487c8e 100644 --- a/.github/workflows/spec-sync-on-merge.yml +++ b/.github/workflows/spec-sync-on-merge.yml @@ -147,11 +147,10 @@ jobs: # 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') - # Create blob and commit via API (commits created through the API are automatically signed by GitHub) - BLOB_SHA=$(gh api "repos/${SPEC_REPO}/git/blobs" \ - -f "content=$(base64 -w 0 controller.json)" \ - -f "encoding=base64" \ - --jq '.sha') + # Create blob via API using --input to avoid ARG_MAX limit on large specs + BLOB_SHA=$(base64 -w 0 controller.json | \ + jq -Rs '{content: ., encoding: "base64"}' | \ + gh api "repos/${SPEC_REPO}/git/blobs" --input - --jq '.sha') TREE_SHA=$(gh api "repos/${SPEC_REPO}/git/trees" \ -f "base_tree=${BASE_TREE_SHA}" \