Skip to content

pin GitHub Actions to commit SHA#360

Closed
sobhe-Starkware wants to merge 3 commits into
benchmark-action:masterfrom
starkware-libs:pin-github-actions-to-sha
Closed

pin GitHub Actions to commit SHA#360
sobhe-Starkware wants to merge 3 commits into
benchmark-action:masterfrom
starkware-libs:pin-github-actions-to-sha

Conversation

@sobhe-Starkware

@sobhe-Starkware sobhe-Starkware commented Jul 21, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • Reliability

    • Updated automated benchmark and testing workflows to use fixed, SHA-pinned GitHub Actions for checkout, toolchain setup, caching, and benchmark result uploads.
    • Kept existing CI/benchmark logic, commands, and result-reporting behavior unchanged to avoid unexpected workflow differences.
  • Documentation

    • Added a new v1.20.7 entry to the changelog (under Unreleased), including the release date and link.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

📝 Walkthrough

Walkthrough

GitHub Actions references are changed from floating version tags to pinned commit SHAs across benchmark and CI workflows. Result-repository jobs also update previous-data preparation, and the changelog adds a v1.20.7 release entry dated 06 Sep 2025.

Changes

Workflow action pinning

Layer / File(s) Summary
Standalone benchmark workflow pins
.github/workflows/benchmarkdotnet.yml, .github/workflows/benchmarkjs.yml, .github/workflows/catch2*.yml, .github/workflows/commit-comment.yml, .github/workflows/cpp.yml, .github/workflows/go.yml, .github/workflows/java.yml, .github/workflows/julia.yml, .github/workflows/minimal.yml, .github/workflows/pytest.yml, .github/workflows/rust*.yml, .github/workflows/validate-action-typings.yml
Checkout, toolchain, cache, benchmark-result, and typing-validation actions now use commit-SHA references.
Benchmark results repository workflow pins
.github/workflows/ci-results-repo.yml
Language-specific benchmark jobs pin checkout, setup, cache, and toolchain actions; separate-results jobs copy dist/other-repo/data.js into before_data.js.
Main CI workflow pins
.github/workflows/ci.yml
Benchmark, cache, unit-test, lint, and Codecov action references are pinned to commits.

Release changelog

Layer / File(s) Summary
v1.20.7 changelog entry
CHANGELOG.md
Adds the v1.20.7 release heading, link, and 06 Sep 2025 date.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: ktrz

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: pinning GitHub Actions references to commit SHAs across workflows.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/benchmarkdotnet.yml (1)

24-24: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use the updated repository name for the benchmark action.

This workflow still references the outdated rhysd namespace, whereas the repository has moved to benchmark-action (as used in other workflows). For consistency and to avoid relying on GitHub redirects, consider updating the namespace here and on line 38.

♻️ Proposed refactor
-        uses: rhysd/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1
+        uses: benchmark-action/github-action-benchmark@52576c92bccf6ac60c8223ec7eb2565637cae9ba # v1
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/benchmarkdotnet.yml at line 24, Update both benchmark
action references in the workflow to use the current benchmark-action repository
namespace instead of rhysd, while preserving the existing pinned revision and
workflow behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/commit-comment.yml:
- Line 16: Add persist-credentials: false to every actions/checkout step in
.github/workflows/commit-comment.yml:16, .github/workflows/cpp.yml:16,
.github/workflows/go.yml:16, .github/workflows/java.yml:16,
.github/workflows/julia.yml:25, .github/workflows/minimal.yml:16,
.github/workflows/pytest.yml:16, and .github/workflows/rust-criterion-rs.yml:16;
leave the existing checkout revisions unchanged.

---

Nitpick comments:
In @.github/workflows/benchmarkdotnet.yml:
- Line 24: Update both benchmark action references in the workflow to use the
current benchmark-action repository namespace instead of rhysd, while preserving
the existing pinned revision and workflow behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fa1a20ab-3506-413a-babb-7bae3bbd0644

📥 Commits

Reviewing files that changed from the base of the PR and between 86d8bcf and 11ccb89.

📒 Files selected for processing (17)
  • .github/workflows/benchmarkdotnet.yml
  • .github/workflows/benchmarkjs.yml
  • .github/workflows/catch2.yml
  • .github/workflows/catch2_v2.yml
  • .github/workflows/ci-results-repo.yml
  • .github/workflows/ci.yml
  • .github/workflows/commit-comment.yml
  • .github/workflows/cpp.yml
  • .github/workflows/go.yml
  • .github/workflows/java.yml
  • .github/workflows/julia.yml
  • .github/workflows/minimal.yml
  • .github/workflows/pytest.yml
  • .github/workflows/rust-criterion-rs.yml
  • .github/workflows/rust.yml
  • .github/workflows/validate-action-typings.yml
  • CHANGELOG.md

steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Disable checkout credential persistence in these workflows.

actions/checkout writes the GitHub token into local git config by default. Add persist-credentials: false to each checkout step in:

  • .github/workflows/commit-comment.yml
  • .github/workflows/cpp.yml
  • .github/workflows/go.yml
  • .github/workflows/java.yml
  • .github/workflows/julia.yml
  • .github/workflows/minimal.yml
  • .github/workflows/pytest.yml
  • .github/workflows/rust-criterion-rs.yml
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 16-16: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

📍 Affects 8 files
  • .github/workflows/commit-comment.yml#L16-L16 (this comment)
  • .github/workflows/cpp.yml#L16-L16
  • .github/workflows/go.yml#L16-L16
  • .github/workflows/java.yml#L16-L16
  • .github/workflows/julia.yml#L25-L25
  • .github/workflows/minimal.yml#L16-L16
  • .github/workflows/pytest.yml#L16-L16
  • .github/workflows/rust-criterion-rs.yml#L16-L16
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/commit-comment.yml at line 16, Add persist-credentials:
false to every actions/checkout step in .github/workflows/commit-comment.yml:16,
.github/workflows/cpp.yml:16, .github/workflows/go.yml:16,
.github/workflows/java.yml:16, .github/workflows/julia.yml:25,
.github/workflows/minimal.yml:16, .github/workflows/pytest.yml:16, and
.github/workflows/rust-criterion-rs.yml:16; leave the existing checkout
revisions unchanged.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

11-14: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Explicitly declare workflow permissions.

To adhere to the principle of least privilege, explicitly declare a permissions block at the workflow or job level rather than relying on defaults. Depending on repository settings, default permissions may grant overly broad write-all access.

As per static analysis hints, this workflow is flagged for excessive permissions because it relies on default access.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 11 - 14, Update the CI workflow or the
benchmarkdotnet-framework job to explicitly declare a least-privilege
permissions block, granting only the access required by its steps and avoiding
inherited or write-all defaults.

Source: Linters/SAST tools

🧹 Nitpick comments (1)
.github/workflows/ci-results-repo.yml (1)

11-14: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Define explicit workflow or job permissions.

The workflow relies on default token permissions because a permissions block is not defined. To follow the principle of least privilege and mitigate security risks, explicitly define permissions (e.g., contents: read) at the workflow or job level.

As per static analysis hints from zizmor, default permissions are used due to a missing permissions block (excessive-permissions).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-results-repo.yml around lines 11 - 14, Add an explicit
least-privilege permissions block to the workflow containing the
benchmarkdotnet-framework job, granting only contents: read unless a narrower
permission is required by the existing steps. Keep the job’s current behavior
unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 11-14: Update the CI workflow or the benchmarkdotnet-framework job
to explicitly declare a least-privilege permissions block, granting only the
access required by its steps and avoiding inherited or write-all defaults.

---

Nitpick comments:
In @.github/workflows/ci-results-repo.yml:
- Around line 11-14: Add an explicit least-privilege permissions block to the
workflow containing the benchmarkdotnet-framework job, granting only contents:
read unless a narrower permission is required by the existing steps. Keep the
job’s current behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dc53b373-273a-4f73-a0fc-a90f0c1a5bc5

📥 Commits

Reviewing files that changed from the base of the PR and between 11ccb89 and 48628af.

📒 Files selected for processing (3)
  • .github/workflows/benchmarkjs.yml
  • .github/workflows/ci-results-repo.yml
  • .github/workflows/ci.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/benchmarkjs.yml

@sobhe-Starkware
sobhe-Starkware deleted the pin-github-actions-to-sha branch July 22, 2026 07:21
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.

2 participants