sqlite-database-integration icon indicating copy to clipboard operation
sqlite-database-integration copied to clipboard

Release workflows: pass expression values via env instead of interpolating them into run scripts

Open 0xABCD01 opened this issue 1 month ago • 0 comments

Summary

Five ${{ ... }} expressions are interpolated directly into run: shell scripts in the release workflows. GitHub's security guidance for script injection recommends passing values to shell scripts through env: variables instead, because an expression expanded inside a script is substituted before the shell parses it. Several steps in these same workflows already follow the env: pattern (e.g. BRANCH, VERSION, CHANGELOG in release-publish.yml); the remaining direct interpolations are inconsistent with that pattern:

release-wporg.yml:

  • "Resolve tag" step: TAG="${{ inputs.tag }}" — the tag comes from workflow_dispatch / workflow_call input.
  • "Download plugin zip from release" step: --repo "${{ github.repository }}".
  • "Verify release metadata" step: "${{ steps.resolve.outputs.version }}" as a script argument.

release-publish.yml:

  • "Get contributors from changelog PRs" step: ${{ github.repository_owner }} and ${{ github.event.repository.name }} inside the GraphQL query string.
  • "Create GitHub release" step: if [[ "${{ steps.version.outputs.prerelease }}" == "true" ]].

Suggested fix

Move each value into the step's env: block and reference the shell variable in the script, matching the pattern already used elsewhere in these files. This is behavior-preserving: the same values reach the same commands, only the substitution mechanism changes.

Note: this is defense-in-depth hardening. The workflows are only reachable by maintainers (merged release/* pull requests and manual dispatch), so no privilege boundary is crossed today; the fix removes a class of footgun if inputs, branch naming, or triggers ever change.

0xABCD01 avatar Nov 01 '26 11:11 0xABCD01