ci(release): harden auto-release against quotes in commit messages#4
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 commitmessage containing a literal double quote —
— terminated the bash string early, and the leftover text
by section in the READMEwas 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, andCOMMITSthroughenv:instead ofinlining them with
${{ }}. Bash now receives them as real environmentvariables that are never re-parsed as script source, so quotes,
backticks, and
$()in any commit message are inert. Applied the samehardening 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🤖 Generated with Claude Code