Harden GitHub workflows against action supply-chain risk#39
Harden GitHub workflows against action supply-chain risk#39blackopsrepl merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fca786dc23
ℹ️ 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".
| release_args+=(--prerelease) | ||
| fi | ||
|
|
||
| gh release create "${release_args[@]}" |
There was a problem hiding this comment.
Require the release tag to exist before publishing
gh release create will auto-create v${{ steps.version.outputs.version }} when that tag is missing. In this workflow the version value is entered manually on workflow_dispatch, so a typo or a forgotten git push --tags now publishes a brand-new tag at ${{ github.sha }} instead of failing fast. Adding --verify-tag (or checking the tag first) would prevent accidentally cutting a release from the wrong commit.
Useful? React with 👍 / 👎.
fca786d to
ad1436d
Compare
|
Codex review was correct. On the rebased branch, |
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