Skip to content

ci(release): harden auto-release against quotes in commit messages#4

Merged
xergioalex merged 1 commit into
mainfrom
ci/fix-auto-release-quoted-commits
Jun 1, 2026
Merged

ci(release): harden auto-release against quotes in commit messages#4
xergioalex merged 1 commit into
mainfrom
ci/fix-auto-release-quoted-commits

Conversation

@xergioalex
Copy link
Copy Markdown
Member

Summary

The auto-release job failed on the last merge to main (exit code 127).

Root cause: the Update CHANGELOG.md step built the commit list with
COMMITS="${{ steps.version.outputs.commits }}". GitHub Actions expands
${{ }} into the script source before bash runs it, so a commit
message containing a literal double quote —

docs(skill): use the official Dailybot "Powered by" section in the README

— terminated the bash string early, and the leftover text by section in the README was executed as a command (No such file or directory,
exit 127). It's also a textbook GitHub Actions script-injection vector.

Fix

Pass NEW_VERSION, NEW_TAG, and COMMITS through env: instead of
inlining them with ${{ }}. Bash now receives them as real environment
variables that are never re-parsed as script source, so quotes,
backticks, and $() in any commit message are inert. Applied the same
hardening to the Bump version and Commit, tag, push steps for
consistency.

Validation

  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/auto-release.yml'))" → OK
  • No behavior change to the version-bump logic; once merged, auto-release re-runs over the same backlog and should cut the pending release cleanly.

🤖 Generated with Claude Code

The "Update CHANGELOG.md" step inlined the commit log into the shell
script with `COMMITS="${{ steps.version.outputs.commits }}"`. GitHub
Actions substitutes `${{ }}` into the script *source* before bash runs,
so a commit message containing a double quote — e.g.

  docs(skill): use the official Dailybot "Powered by" section in the README

closed the bash string early and the remainder ("by section in the
README") was executed as a command, failing the job with exit 127. This
is also a classic GHA script-injection vector.

Pass NEW_VERSION, NEW_TAG, and COMMITS through `env:` instead, so bash
receives them as real environment variables that are never re-parsed as
script source. Quotes, backticks, and $() in commit messages are now
inert.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@xergioalex xergioalex merged commit 10ad216 into main Jun 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant