Skip to content

Harden GitHub workflows against action supply-chain risk#39

Merged
blackopsrepl merged 1 commit intomainfrom
codex/fix-vulnerability-in-ci-workflows
Mar 23, 2026
Merged

Harden GitHub workflows against action supply-chain risk#39
blackopsrepl merged 1 commit intomainfrom
codex/fix-vulnerability-in-ci-workflows

Conversation

@blackopsrepl
Copy link
Copy Markdown
Contributor

Motivation

  • The workflows referenced mutable third‑party GitHub Action tags (e.g. actions/checkout@v4, actions/cache@v4, softprops/action-gh-release@v1), creating a supply‑chain risk that could exfiltrate CI secrets such as CARGO_REGISTRY_TOKEN.
  • The goal is a minimal, workflow-only remediation to remove mutable uses: references while preserving CI/build/publish behavior.

Description

  • Replaced uses: actions/checkout@... steps in ci.yml, publish-crates.yml, and release.yml with explicit shell-based checkout steps using git and the github.token to avoid relying on mutable action tags.
  • Removed the actions/cache@v4 cache steps from the workflows to eliminate another unpinned third‑party action dependency.
  • Replaced softprops/action-gh-release@v1 with a gh release create shell step (using GITHUB_TOKEN) that preserves release notes and prerelease handling without invoking an unpinned external action.
  • Files modified: .github/workflows/ci.yml, .github/workflows/publish-crates.yml, and .github/workflows/release.yml.

Testing

  • Ran rg -n "uses:" .github/workflows to verify the unpinned uses: references were removed and this check passed.
  • Validated workflow YAML by loading each file with ruby -e 'YAML.load_file(...)' and this succeeded for all modified files.
  • Ran git diff --check to ensure there were no whitespace or git-diff issues and it returned clean.
  • Ran cargo test and the test suite completed successfully (0 tests; all checks passed).

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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[@]}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@blackopsrepl blackopsrepl force-pushed the codex/fix-vulnerability-in-ci-workflows branch from fca786d to ad1436d Compare March 23, 2026 14:17
@blackopsrepl
Copy link
Copy Markdown
Contributor Author

Codex review was correct. On the rebased branch, workflow_dispatch still accepts a manual version, and gh release create would auto-create a missing v<version> tag at ${{ github.sha }}. That means a typo or missing pushed tag could cut a release from the wrong commit instead of failing fast. I updated the release step to pass --verify-tag so the tag must already exist. Local validation passed with cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test.

@blackopsrepl blackopsrepl merged commit a8db50f into main Mar 23, 2026
1 check passed
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.

1 participant