fix(ci): pass commits JSON via env block to avoid bash quoting break (#526) #528

Merged
core-lead merged 1 commits from ci/harness-replays-detect-changes-quoting-fix into main 2026-05-11 17:58:14 +00:00

1 Commits

Author SHA1 Message Date
783d5fb8d8 fix(ci): pass commits JSON via env block to avoid bash quoting break
All checks were successful
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 14s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 14s
Harness Replays / detect-changes (pull_request) Successful in 16s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 16s
sop-tier-check / tier-check (pull_request) Successful in 17s
Harness Replays / Harness Replays (pull_request) Successful in 6s
CI / Detect changes (pull_request) Successful in 55s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 55s
E2E API Smoke Test / detect-changes (pull_request) Successful in 1m1s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 59s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 55s
CI / Platform (Go) (pull_request) Successful in 8s
CI / Python Lint & Test (pull_request) Successful in 7s
CI / Canvas (Next.js) (pull_request) Successful in 11s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 9s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 11s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 13s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 10s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 11s
audit-force-merge / audit (pull_request) Successful in 14s
The detect-changes step's push path used `echo '${{ toJSON(github.event.commits) }}'`
which broke on every main push because every main commit is a Gitea merge commit
whose message contains single quotes (e.g. "Merge pull request 'fix: ...' from branch
into main"). The embedded `'` ended the single-quoted bash string mid-JSON, and a
subsequent `(` (e.g. in "#523)") was parsed as a subshell → "syntax error near
unexpected token `('". This caused detect-changes to exit 2 → main-red.

Fix: pass the JSON via an `env:` block (env values bypass shell quoting entirely)
and pipe it to the script using `printf '%s' "$COMMITS_JSON"`.

Closes #526.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:50:17 +00:00