Skip to content

Lock GitHub Actions workflow dependencies with actions.lock - #1414

Open
Konboi wants to merge 1 commit into
mainfrom
worktree-gh-lock
Open

Konboi wants to merge 1 commit into
mainfrom
worktree-gh-lock

Conversation

@Konboi

@Konboi Konboi commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adopt GitHub Actions workflow lockfiles (public preview) using gh actions-lock v0.4.0.

  • .github/workflows/actions.lock (new): pins every direct and transitive action (including those pulled in by composite actions such as smart-tests-results-upload-action, pre-commit/action, attest-build-provenance) to a verified commit.
  • Workflow uses: refs: rewritten to exact tags. The commit SHA now lives in the lockfile instead of inline @<sha> # vX comments.
    • Every existing SHA pin resolves to the same commit as before (no behavior change).
    • Floating refs were narrowed to their current highest tag (e.g. actions/checkout@v4 → v4.4.0, actions/checkout@v6 → v6.1.0, actions/setup-java@v4 → v4.9.1, smart-tests-results-upload-action@v1 → v1.3.0).
  • .github/workflows/verify-lockfile.yml (new): runs gh actions-lock --verify on PRs, pushes to main, and weekly (to detect re-pointed upstream tags). Based on the upstream template, with the extension pinned to v0.4.0.

Maintenance

When adding a workflow or changing any uses:, run gh actions-lock and commit actions.lock together with the workflow change. Use gh actions-lock --relock to advance pins.

Test plan

  • gh actions-lock --verify passes locally (exit 0, valid: true)
  • verify-lockfile workflow passes on this PR
  • Existing workflows (test, bazel-test, e2e, pre-commit) pass

🤖 Generated with Claude Code

Adopt the workflow dependency lockfile (public preview) via
`gh actions-lock` v0.4.0:

- Generate .github/workflows/actions.lock pinning every direct and
  transitive action to a verified commit.
- Rewrite `uses:` refs to exact tags; the lockfile now carries the
  commit SHA. Existing SHA pins resolve to the same commits, and
  floating refs (v4, v6, v1, ...) are narrowed to their current tags.
- Add verify-lockfile workflow running `gh actions-lock --verify` on
  PRs, pushes to main, and weekly to catch re-pointed tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Konboi
Konboi requested review from gayanW and ono-max October 26, 2026 06:28
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v7.0.1

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.

Nit: It might be better to specify the commit hash here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, we don't have to specify the commit hash when we use GHA actions.lock feature

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Oh, I see. That's good 👍

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