Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,19 @@ jobs:
commit_sha="${RELEASE_COMMIT}"
echo "Reusing existing release commit ${commit_sha}"
else
make_blob() {
jq -nc --arg content "$(base64 -w0 <"$1")" \
# Stage the base64 in a temp file and feed it to jq via
# --rawfile: passing big blobs (the PGO profile is ~2 MB encoded)
# through --arg exceeds ARG_MAX on the runner. Subshell body +
# EXIT trap clean up the tmpfile even if base64/jq/gh aborts.
make_blob() (
local tmp
tmp=$(mktemp)
trap 'rm -f "$tmp"' EXIT
base64 -w0 <"$1" >"$tmp"
jq -nc --rawfile content "$tmp" \
'{content: $content, encoding: "base64"}' \
| gh api "repos/${REPO}/git/blobs" --input - -q .sha
}
)

parent_sha=$(gh api "repos/${REPO}/git/refs/heads/main" -q .object.sha)
base_tree=$(gh api "repos/${REPO}/git/commits/${parent_sha}" -q .tree.sha)
Expand Down
Loading