Skip to content

fix: separate version injection commands to unblock release#22

Merged
jericht merged 1 commit into
OpenJobDescription:mainlinefrom
jericht:jericht/fix_release
Jul 9, 2026
Merged

fix: separate version injection commands to unblock release#22
jericht merged 1 commit into
OpenJobDescription:mainlinefrom
jericht:jericht/fix_release

Conversation

@jericht

@jericht jericht commented Jul 9, 2026

Copy link
Copy Markdown

What was the problem/requirement? (What/Why)

The security hardening in #21 moved ${{ inputs.version-script }} from run: into an env var to prevent script injection (zizmor). However, the default value contains && which is not re-parsed as a shell operator when expanded from a variable — bash treats it as a literal argument. This broke the InjectVersion step for all consumers on all platforms.

Example openjd-model release: https://github.com/OpenJobDescription/openjd-model-for-python/actions/runs/28989508762

What was the solution? (How)

Split the single version-script input into two: version-script-deps (pip packages to install) and version-script (simple command to run). Each gets its own step. No compound shell operators needed in variables.

What is the impact of this change?

Fixes the release workflow for all repos using this reusable workflow. Callers relying on the defaults (like openjd-model-for-python) need no changes. Callers that override version-script with a compound command will need to split their input across the two new inputs.

How was this change tested?

Reproduced locally:

$ echo '$VERSION_SCRIPT' > /tmp/test.sh
$ VERSION_SCRIPT='pip install setuptools_scm && python scripts/maturin_build.py --version-only' \
>     bash --noprofile --norc -eo pipefail /tmp/test.sh

[optparse.groups]Usage:[/]   
  pip install \[options] <requirement specifier> \[package-index-options] ...
  pip install \[options] -r <requirements file> \[package-index-options] ...
  pip install \[options] [-e] <vcs project url> ...
  pip install \[options] [-e] <local project path> ...
  pip install \[options] <archive url/path> ...

no such option: --version-only

Confirmed the split approach works:

$ echo '$VERSION_SCRIPT' > /tmp/step2.sh
$ VERSION_SCRIPT='python scripts/maturin_build.py --version-only' bash --noprofile --norc -eo pipefail /tmp/step2.sh
Wrote src/openjd/model/_version.py (version 0.10.1.post10+gf377934)
Patched pyproject.toml: project.version = '0.10.1.post10+gf377934'

Was this change documented?

Input descriptions updated in the workflow file.

Is this a breaking change?

Yes for callers that override version-script with a compound command — they must split across the two new inputs. Callers using
defaults are unaffected.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your
choice.

Signed-off-by: Jericho Tolentino <68654047+jericht@users.noreply.github.com>
@jericht
jericht requested a review from a team as a code owner July 9, 2026 03:06
@jericht
jericht merged commit 0500f0a into OpenJobDescription:mainline Jul 9, 2026
3 checks passed
@jericht
jericht deleted the jericht/fix_release branch July 9, 2026 17:02
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.

4 participants