Repository navigation
Pass release workflow inputs through env instead of interpolation - #137
Pierre Massat (phacops) wants to merge 1 commit into
Conversation
The release workflow pasted ${{ inputs.* }} values straight into run:
scripts, so a crafted version string would execute as shell code in a
job holding the bot token and AWS credentials. Read the inputs from
step env vars instead, and validate services_version as semver before
it reaches GITHUB_ENV and lock_versions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01449dBcsndUJDCqCacbrEvW
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a69c3e37a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
|
|
||
| # The value is written to GITHUB_ENV and passed to lock_versions, | ||
| # so reject anything that is not a v-prefixed semver tag. | ||
| if [[ ! $SERVICES_VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$ ]]; then |
There was a problem hiding this comment.
Preserve non-semver service image tags
When services_version is a commit SHA or custom image tag such as latest, this new regex exits before invoking lock_versions. Those inputs worked previously, and lock_versions --help explicitly documents latest, so this prevents releases from pinning supported non-semver builds; validate the value for safe transport without restricting it to semver.
AGENTS.md reference: AGENTS.md:L7-L11
Useful? React with 👍 / 👎.
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge. SummaryThis PR moves release inputs out of shell script text and into step environment variables.
No actionable issues were found. Reviews (1) · Last reviewed commit: "Pass release workflow inputs through env..." · Reviewed by Greptile |
Summary
release.ymlinterpolated${{ github.event.inputs.version }},${{ inputs.services_version }}and${{ inputs.force_republish }}directly intorun:scripts. A crafted input would run as shell code in a job that holds the bot token and the AWS role. This PR:env:vars (INPUT_VERSION,INPUT_SERVICES_VERSION,FORCE_REPUBLISH);services_versionas v-prefixed semver before it reachesGITHUB_ENVandlock_versions.Release behavior is otherwise unchanged.
Testing
run:block passesbash -n.1.2.3,v2.25.0and1.2.3-rc.1.1.2.3; touch /tmp/pwnandabc../test.shpasses (675 tests).Generated by Claude Code