Skip to content

ci: pass the release version to scripts only through env (SECOPS-1274) - #575

Merged
somanshreddy merged 2 commits into
mainfrom
11-16-ci_pass_release_version_through_env
Nov 16, 2026
Merged

somanshreddy merged 2 commits into
mainfrom
11-16-ci_pass_release_version_through_env

Conversation

@somanshreddy

@somanshreddy somanshreddy commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Scope

Surfaces: CI (release workflows) | Module: Release

Summary

Hardens how the release workflows handle the version input. Live on merge, with no change to a normal release.

How it works

  • Workflow inputs reach shell scripts only through environment variables, never pasted into the script text.
  • The version is checked against the release pattern before anything uses it, and every later step and job uses that checked value.
  • The release helper scripts check their own arguments too.
  • Release builds start from a clean Go cache.

Details are in the linked SecOps issue.

Testing

  • Ran the old and new version-check steps locally against malformed inputs. The new step rejects them and prints the input as plain text. A valid version still passes.
  • The helper scripts reject malformed arguments before making any API call.
  • actionlint (with shellcheck) passes on both workflows, and shellcheck passes on the scripts.

🤖 Generated with Claude Code

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

APPROVE. Reviewed at 368a09cce4b1e7fa0bdb442a0608fd25bb7de40d.

Every workflow input and step output now reaches shell only through env:, and each value is checked before use: the version is validated in a step whose output everything downstream reads, and the cleanup and draft scripts validate tag, commit and run ID before they go into API paths, jq filters and refspecs.

Checked:

  • No ${{ }} expression is left in any run: block in any workflow at the stack head (a YAML walk over .github/workflows/*.yml printed nothing). The remaining expressions sit in env:, with: and outputs:, where they are not shell.
  • The dev tag pattern -dev\.[0-9]{12} matches what dev-release.yml produces (date -u +%Y%m%d%H%M) and the existing tags (for example v0.6.1-dev.202608120628).
  • cleanup runs only when tag_push_attempted == 'true', which comes after the version step, so outputs.tag is never empty there.
  • Turning off setup-go's cache on both release workflows closes a poisoned-cache path from other main runs. The cost is build time, which is fine for a release.

Nit (non-blocking): the version regex allows leading zeros, so v0.11.00 passes as a new version even though it is v0.11.0 again. Details and a suggested regex are in the #576 review, since the CDN check is where it shows.

Need: yes, release inputs reached shell unquoted · Size: ok · Reuse: nothing to reuse (same env-only pattern the commit input already used) · Simpler: already minimal · Structure: fine (checked the existing COMMIT env pattern in the same file; no split)
Risk: medium — release pipeline for a public installer; behavior change is input handling only.

— Rames

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

APPROVE (re-review). Reviewed at 06db8dc0ea5dcc56e2334d0817f84b45d845b742. The delta since 368a09cc is the one commit 06db8dc, which changes only the regex.

The leading-zero nit is fixed. The version-validation step, cleanup-failed-release.sh and find-run-draft.sh now use ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*) (with the optional -dev\.[0-9]{12} suffix in the two scripts).

Dev tags still pass. I ran the new script pattern over all 141 tags in the repo:

  • 138 match.
  • The 3 rejections are the April-era v0.0.1-dev.20260407.<sha> tags. The round-1 pattern already rejected them, and dev-release.yml no longer produces that shape. Its awk printf "%d.%d.%d" can't emit leading zeros, and the 12-digit timestamp still matches.

Spot checks:

  • Accepted: v0.6.1-dev.202608120628, v0.0.0, v10.20.30
  • Rejected: v0.11.00, v0.011.0, v00.1.0, v0.6.01-dev.…, v1.2.3-rc.1

Need: yes · Size: ok · Reuse: nothing to reuse · Simpler: already minimal · Structure: fine (checked the round-1 patterns in the same three sites; no split)
Risk: medium — release pipeline; this delta only narrows accepted input.

— Rames

@somanshreddy
somanshreddy merged commit 6f46ada into main Nov 16, 2026
9 of 10 checks passed
@somanshreddy
somanshreddy deleted the 11-16-ci_pass_release_version_through_env branch November 16, 2026 01:15
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