Skip to content

Provide pinning for GitHub Actions - #182

Merged
lucperkins merged 5 commits into
mainfrom
actions-pinning
Jun 1, 2026
Merged

lucperkins merged 5 commits into
mainfrom
actions-pinning

Conversation

@lucperkins

@lucperkins lucperkins commented May 12, 2026 •

Copy link
Copy Markdown
Member

This pins our GitHub Actions and provides automated updates. This PR also specifies cooldown for npm dependencies.

Summary by CodeRabbit

  • Chores
    • Simplified and strengthened dependency update configuration: grouping, weekly cadence, cooldown, commit/label behavior, and semver-specific thresholds for npm updates.
    • Pinned CI and downstream workflow actions to specific commits to improve reproducibility and security.
    • Added repository policy rules to enforce ref-pinning for referenced actions.
    • Added a new automated workflow to run checks on pushes to main and on pull requests.

@netlify

netlify Bot commented May 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for detsys-ts-docs ready!

Name Link
🔨 Latest commit f2ac2d8
🔍 Latest deploy log https://app.netlify.com/projects/detsys-ts-docs/deploys/6a1dad0e17d28a000828dd14
😎 Deploy Preview https://deploy-preview-182--detsys-ts-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented May 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 880d231a-1f45-4c14-8ea1-14d70f96e04d

📥 Commits

Reviewing files that changed from the base of the PR and between c452cdd and f2ac2d8.

📒 Files selected for processing (1)
  • .github/workflows/zizmor.yml

📝 Walkthrough

Walkthrough

This PR pins GitHub Actions in workflows, updates Dependabot to weekly updates with cooldown and semver thresholds, and adds Zizmor ref-pin policy plus a workflow that enforces it.

Changes

Actions Pinning and Dependency Management Policy

Layer / File(s) Summary
Dependabot configuration for automated updates
.github/dependabot.yml
Dependabot entries for github-actions and npm ecosystems now run weekly at /, add a 7-day cooldown, simplified group patterns, commit-message prefix ci, dependency-related labels, npm semver-specific day thresholds, and an ignore rule for DeterminateSystems/*.
Workflow action pinning
.github/workflows/ci.yml, .github/workflows/update-downstream.yml
Pinned actions/checkout to a specific commit SHA, set persist-credentials: false on checkouts, switched DeterminateSystems/determinate-nix-action from @v3 to @main, and pinned peter-evans/create-pull-request to a specific commit in update-downstream.
Zizmor policy enforcement and workflow
.github/zizmor.yml, .github/workflows/zizmor.yml
Adds rules.unpinned-uses with policies.DeterminateSystems/*: ref-pin to .github/zizmor.yml and a zizmor workflow that runs zizmorcore/zizmor-action pinned by SHA using that config.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit hops through pinned commits and cheer,
Weekly updates tidy each dependency near,
Zizmor watches refs with an earnest grin,
Dependabot hums its quiet weekly din,
Together they keep the repo snug and clear. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 changes: pinning GitHub Actions across multiple workflows and configuration files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch actions-pinning

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

@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: 2

🤖 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/dependabot.yml:
- Around line 33-35: The labels array under the npm ecosystem's configuration
incorrectly contains "github-actions"; update the labels entry (the labels: list
associated with the npm ecosystem block) to replace "github-actions" with "npm"
so the dependabot config correctly tags npm updates with the npm label.

In @.github/zizmor.yml:
- Around line 1-5: Replace the unpinned usage of
DeterminateSystems/flakehub-cache-action@main in both CI workflows with a commit
SHA pin (same pattern used for DeterminateSystems/determinate-nix-action); find
the desired commit SHA in the DeterminateSystems/flakehub-cache-action
repository (use the full 40-character commit SHA from the commit you want to
track) and update the action references in the two workflow files that currently
reference DeterminateSystems/flakehub-cache-action@main so they read
DeterminateSystems/flakehub-cache-action@<commit-sha>, ensuring both occurrences
are changed.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7e4e6c85-f84b-4711-94fa-80f3ae1fb76c

📥 Commits

Reviewing files that changed from the base of the PR and between 65d8cdf and 57bbc6a.

📒 Files selected for processing (4)
  • .github/dependabot.yml
  • .github/workflows/ci.yml
  • .github/workflows/update-downstream.yml
  • .github/zizmor.yml

Comment thread .github/dependabot.yml Resolved
Comment thread .github/zizmor.yml Resolved

@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: 2

🤖 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/ci.yml:
- Around line 21-22: Replace the mutable `@main` refs for the DeterminateSystems
actions with immutable 40-character commit SHAs: update the two usages
"DeterminateSystems/determinate-nix-action@main" and
"DeterminateSystems/flakehub-cache-action@main" to use their specific commit
SHAs (full 40-char values) so the workflow runs a pinned, immutable revision;
obtain the appropriate commit SHA for each action from their repository and
substitute it in place of "@main".

In @.github/workflows/update-downstream.yml:
- Around line 67-70: The workflow uses mutable refs for external actions;
replace the two uses lines referencing
DeterminateSystems/determinate-nix-action@main and
DeterminateSystems/flakehub-cache-action@main with immutable commit SHAs: locate
the uses entries for "DeterminateSystems/determinate-nix-action" and
"DeterminateSystems/flakehub-cache-action", find the appropriate commit SHA for
each action (e.g., from their GitHub repo commit history) and substitute `@main`
with @<full-commit-sha> for both entries so the workflow is pinned to specific
commits.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6fdb1f16-e231-46f5-b9d5-a58143e29471

📥 Commits

Reviewing files that changed from the base of the PR and between 57bbc6a and c452cdd.

📒 Files selected for processing (3)
  • .github/dependabot.yml
  • .github/workflows/ci.yml
  • .github/workflows/update-downstream.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/dependabot.yml

Comment thread .github/workflows/ci.yml
Comment on lines +21 to 22
- uses: DeterminateSystems/determinate-nix-action@main
- uses: DeterminateSystems/flakehub-cache-action@main

@coderabbitai coderabbitai Bot May 12, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Identify action refs in workflows that are not pinned to 40-char commit SHAs.
rg -nP 'uses:\s*[^@]+@(?!(?:[0-9a-f]{40}\b))\S+' .github/workflows

Repository: DeterminateSystems/detsys-ts

Length of output: 456


Pin DeterminateSystems action refs to commit SHAs instead of @main.

Using @main is mutable and weakens supply-chain security guarantees. Pin to specific 40-character commit SHAs to ensure immutable workflow execution.

Suggested change
-      - uses: DeterminateSystems/determinate-nix-action@main
-      - uses: DeterminateSystems/flakehub-cache-action@main
+      - uses: DeterminateSystems/determinate-nix-action@<commit-sha>
+      - uses: DeterminateSystems/flakehub-cache-action@<commit-sha>
🤖 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 21 - 22, Replace the mutable `@main`
refs for the DeterminateSystems actions with immutable 40-character commit SHAs:
update the two usages "DeterminateSystems/determinate-nix-action@main" and
"DeterminateSystems/flakehub-cache-action@main" to use their specific commit
SHAs (full 40-char values) so the workflow runs a pinned, immutable revision;
obtain the appropriate commit SHA for each action from their repository and
substitute it in place of "@main".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

My zizmor config explicitly says that this is okay

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@lucperkins, you're right — I can see from the .github/zizmor.yml changes in this PR that DeterminateSystems/* is explicitly listed under policies with the ref-pin exception. That's a deliberate, documented policy decision. I'll disregard this in future reviews.

ʕ •ᴥ•ʔ


✏️ Learnings added
Learnt from: lucperkins
Repo: DeterminateSystems/detsys-ts PR: 182
File: .github/workflows/ci.yml:21-22
Timestamp: 2026-05-12T18:06:37.874Z
Learning: In the DeterminateSystems/detsys-ts repository, `DeterminateSystems/*` GitHub Actions (e.g., `DeterminateSystems/determinate-nix-actionmain`, `DeterminateSystems/flakehub-cache-actionmain`) are intentionally allowed to use mutable `main` refs rather than pinned commit SHAs. This exception is explicitly declared in `.github/zizmor.yml` under `policies` with `ref-pin` for the `DeterminateSystems/*` namespace, and `DeterminateSystems/*` is also excluded from Dependabot updates in `.github/dependabot.yml`. Do not flag these as unpinned action refs.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment thread .github/workflows/update-downstream.yml Resolved
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@lucperkins
lucperkins enabled auto-merge June 1, 2026 16:02
@lucperkins
lucperkins merged commit ca834b0 into main Jun 1, 2026
6 checks passed
@lucperkins
lucperkins deleted the actions-pinning branch June 1, 2026 16:03

This branch was previously deployed

1 inactive deployment
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.

3 participants