Repository navigation
Pass workflow values via env in release workflows - #604
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Use GITHUB_REPOSITORY for release downloads. Pass the repository owner, name, and prerelease flag to the publish scripts through step environment variables. Fixes WordPress#602
2cb747a to
92288b7
Compare
Let GitHub CLI read the owner and name from the checked-out repository and pass them as query variables. This removes the two step environment variables and the escaped quotes in the query.
Summary
Fixes #602.
Pass expression values to
run:scripts throughenv:variables instead of interpolating${{ ... }}expressions directly into the shell script, following GitHub's script-injection guidance and the pattern already used elsewhere in these workflows (BRANCH,VERSION,CHANGELOG, …).Changes, all behavior-preserving (same values, same commands):
release-wporg.yml:inputs.tagviaINPUT_TAGenv var.github.repositoryviaREPOenv var.steps.resolve.outputs.versionviaVERSIONenv var.release-publish.yml:github.repository_owner/github.event.repository.nameviaREPO_OWNER/REPO_NAMEenv vars used in the GraphQL query string.steps.version.outputs.prereleaseviaPRERELEASEenv var.Notes
This is defense-in-depth hardening: today these workflows are only reachable by maintainers (merged
release/*pull requests, manual dispatch), so nothing is exploitable as-is. Moving the values toenv:removes the substitution-before-parsing footgun if inputs, branch naming, or triggers ever change.Both files remain valid YAML and the modified shell snippets pass
bash -n; the GraphQL query construction produces the identical string as before.Summary by CodeRabbit