Skip to content

fix(extract-version): pass inputs through the environment and check them - #27

Merged
ebourgeois merged 1 commit into
mainfrom
fix/extract-version-inputs
Nov 21, 2026
Merged

ebourgeois merged 1 commit into
mainfrom
fix/extract-version-inputs

Conversation

@ebourgeois

Copy link
Copy Markdown
Contributor

The composite action put the release tag, the PR number, the repository, the suffix and the workflow type straight into its script with ${{ }}, so a release tag name holding shell syntax ran in the calling job, which in a release holds id-token and packages write. Every input now reaches the script through env:, and each is checked before use: the release tag is v.. with an optional -prerelease and +build, the PR number is digits, the repository is owner/name, the suffix is empty or -. A value with a line break can no longer add an output. Build metadata is dropped from the image tag only, since a container tag cannot hold "+".

This repository's own release workflow interpolated the tag the same way, and validated it only after the script had run and written its outputs; it now takes it through env: and validates before writing anything.

Tested by running the action's script with 14 inputs: valid release, release candidate, build metadata, PR and main values give the same outputs as before; $( ), ";", a line break, a missing v, a non-numeric PR number, a bad suffix and a bad repository are refused, and nothing in them runs. Every caller's existing release tags (bindy, bindcar, forage, kube-condition, sceau) pass the new check.

Signed-off-by: Erick Bourgeois erick@jeb.ca

The composite action put the release tag, the PR number, the repository, the suffix and the workflow type straight into its script with ${{ }}, so a release tag name holding shell syntax ran in the calling job, which in a release holds id-token and packages write. Every input now reaches the script through env:, and each is checked before use: the release tag is v<major>.<minor>.<patch> with an optional -prerelease and +build, the PR number is digits, the repository is owner/name, the suffix is empty or -<tag characters>. A value with a line break can no longer add an output. Build metadata is dropped from the image tag only, since a container tag cannot hold "+".

This repository's own release workflow interpolated the tag the same way, and validated it only after the script had run and written its outputs; it now takes it through env: and validates before writing anything.

Tested by running the action's script with 14 inputs: valid release, release candidate, build metadata, PR and main values give the same outputs as before; $( ), ";", a line break, a missing v, a non-numeric PR number, a bad suffix and a bad repository are refused, and nothing in them runs. Every caller's existing release tags (bindy, bindcar, forage, kube-condition, sceau) pass the new check.

Signed-off-by: Erick Bourgeois <erick@jeb.ca>
@ebourgeois
ebourgeois merged commit f432b9a into main Nov 21, 2026
36 checks passed
@ebourgeois
ebourgeois deleted the fix/extract-version-inputs branch November 21, 2026 21:45
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