Harden GitHub workflows against action supply-chain risk#41
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 429a279c9b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
.github/workflows/release.yml
Outdated
| release_args+=(--prerelease) | ||
| fi | ||
|
|
||
| gh release create "${release_args[@]}" |
There was a problem hiding this comment.
Handle existing releases on workflow reruns
This now unconditionally calls gh release create for every tag/manual release. If the workflow is re-run after the release was already created—for example because the job is retried, the run is re-executed, or someone created the release manually first—the command fails instead of updating the existing release. The previous softprops/action-gh-release step was retry-safe for an existing tag, so this is a regression that makes failed release runs non-recoverable without manual cleanup.
Useful? React with 👍 / 👎.
429a279 to
3bc24c0
Compare
|
Codex review was correct. After |
Motivation
actions/checkout@v4,actions/cache@v4,softprops/action-gh-release@v1), creating a supply‑chain risk that could exfiltrate CI secrets such asCARGO_REGISTRY_TOKEN.uses:references while preserving CI/build/publish behavior.Description
uses: actions/checkout@...steps inci.yml,publish-crates.yml, andrelease.ymlwith explicit shell-based checkout steps usinggitand thegithub.tokento avoid relying on mutable action tags.actions/cache@v4cache steps from the workflows to eliminate another unpinned third‑party action dependency.softprops/action-gh-release@v1with agh release createshell step (usingGITHUB_TOKEN) that preserves release notes and prerelease handling without invoking an unpinned external action..github/workflows/ci.yml,.github/workflows/publish-crates.yml, and.github/workflows/release.yml.Testing
rg -n "uses:" .github/workflowsto verify the unpinneduses:references were removed and this check passed.ruby -e 'YAML.load_file(...)'and this succeeded for all modified files.git diff --checkto ensure there were no whitespace or git-diff issues and it returned clean.cargo testand the test suite completed successfully (0 tests; all checks passed).Codex Task