Skip to content

ci: lock workflow actions through an actions.lock lockfile - #212

Open
dylanmtaylor wants to merge 2 commits into
mainfrom
chore/lock-github-actions
Open

dylanmtaylor wants to merge 2 commits into
mainfrom
chore/lock-github-actions

Conversation

@dylanmtaylor

@dylanmtaylor dylanmtaylor commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Applies the lockfile setup from https://hugovk.dev/blog/2026/lock-github-actions/.

  • gh actions-lock replaces the hand-maintained commit SHAs with tag refs such as actions/checkout@v7.0.1, and generates .github/workflows/actions.lock recording the commit each ref resolves to. A moved tag now shows up as a lockfile diff instead of silently running new code.

After editing a workflow, re-run gh actions-lock and commit the lockfile with it.

Summary by CodeRabbit

  • Chores
    • Added automated validation of workflow lockfiles for pull requests, updates to the main branch, and manual runs. This check reports whether workflow dependencies match the recorded lockfile.

Mutable action tags are a supply-chain risk: a moved tag runs different code
without a diff. Every workflow action is now pinned through
.github/workflows/actions.lock, and CI verifies the lockfile so an out-of-sync
or tampered one fails instead of running.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Adds a GitHub Actions workflow that runs lockfile verification on pull requests, pushes to main, and manual dispatch. The workflow uses a read-only Ubuntu job, hardens the runner, checks out without persisted credentials, and installs a pinned verification extension.

Changes: Lockfile verification

Layer / File(s) Summary
Lockfile verification workflow
.github/workflows/lockfile.yml
Adds pull request, main push, and manual triggers. The job hardens the runner, checks out without persisted credentials, installs gh-actions-lock pinned to v0.4.1, and runs gh actions-lock --verify.

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

Change: Other

Merge Risk: Minimal · up to 169dc

This adds a CI check that verifies the actions lockfile on pull requests, pushes to main, and manual runs. It has read-only permissions and no identified production impact, so it is ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "ci: lock workflow actions through an actions.lock lockfile" matches the main change. The PR adds a Lockfile workflow that runs gh actions-lock --verify, and the objectives describe replacin…
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.
Full details: Title check

Explanation

The title "ci: lock workflow actions through an actions.lock lockfile" matches the main change. The PR adds a Lockfile workflow that runs gh actions-lock --verify, and the objectives describe replacing manually maintained commit SHAs with tag refs recorded in .github/workflows/actions.lock. The title is specific, concise, and follows a conventional commit style.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9289d96 and 169dc08.

Files ignored due to path filters: 1

  • .github/workflows/actions.lock is excluded by !**/*.lock
Files selected for processing: 1

  • .github/workflows/lockfile.yml

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Fails the build when .github/workflows/actions.lock stops matching the
workflows, or when a locked pin no longer verifies upstream, so a stale or
tampered lockfile cannot go unnoticed between dependency updates.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

timeout-minutes: 10
steps:
- name: Harden runner
uses: step-security/harden-runner@v2.22.4

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed head 169dc08, both added files, the current shared CI/release callers and exact-head AGENTS. Please move the verification job into storytold/craft-common-actions and call that reusable workflow here, or obtain a documented maintainer exception. The repository's core rule 11 says CI stays shared and workflows call craft-common-actions; the new local runs-on/steps job is a separate implementation rather than a shared caller.

Also qualify the lock coverage in the description/comment. This lockfile has empty lists for CI/release and the other shared callers, while the CI caller still references craft-common-actions/.../gate.yml@main. The two populated dependencies are the checkout/harden-runner steps of the new verifier itself; this is not evidence that the reusable workflow contents or their transitive action refs are locked. Avoid implying moved refs anywhere in the suite are now prevented by this file.

Validation: the exact-head Lockfile check and Linux/Windows gates pass. Sonar analysis reports failure (not diagnosed in this review). No local builds/tests, extension installation or merges performed.

This branch has not been deployed

No deployments
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