Skip to content

Pass release workflow inputs through env instead of interpolation - #137

Open
Pierre Massat (phacops) wants to merge 1 commit into
mainfrom
claude/practical-clarke-yz7ki9-release-inputs
Open

Pierre Massat (phacops) wants to merge 1 commit into
mainfrom
claude/practical-clarke-yz7ki9-release-inputs

Conversation

@phacops

Copy link
Copy Markdown

Summary

release.yml interpolated ${{ github.event.inputs.version }}, ${{ inputs.services_version }} and ${{ inputs.force_republish }} directly into run: scripts. A crafted input would run as shell code in a job that holds the bot token and the AWS role. This PR:

  • reads the inputs from step env: vars (INPUT_VERSION, INPUT_SERVICES_VERSION, FORCE_REPUBLISH);
  • validates services_version as v-prefixed semver before it reaches GITHUB_ENV and lock_versions.

Release behavior is otherwise unchanged.

Testing

  • Every run: block passes bash -n.
  • The services-version step accepts 1.2.3, v2.25.0 and 1.2.3-rc.1.
  • It rejects 1.2.3; touch /tmp/pwn and abc.
  • ./test.sh passes (675 tests).

Generated by Claude Code

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T21:51:55.639512Z 1a69c3e PR opened
ℹ️ About Codex in GitHub

Your 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge.

Summary

This PR moves release inputs out of shell script text and into step environment variables.

  • Release inputs reach the workflow scripts through step environment variables.
  • The release workflow checks services versions before using them for image updates.

No actionable issues were found.

Reviews (1) · Last reviewed commit: "Pass release workflow inputs through env..." · Reviewed by Greptile

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.

2 participants