Skip to content

CI: Pin GitHub Actions to commit SHAs#155089

Closed
Turbo87 wants to merge 1 commit into
rust-lang:mainfrom
Turbo87:pin-github-actions
Closed

CI: Pin GitHub Actions to commit SHAs#155089
Turbo87 wants to merge 1 commit into
rust-lang:mainfrom
Turbo87:pin-github-actions

Conversation

@Turbo87

@Turbo87 Turbo87 commented Apr 10, 2026

Copy link
Copy Markdown
Member

Pin all third-party actions to immutable commit SHAs, with the resolved version tag in a trailing comment. This prevents upstream tags from silently changing under us.

  • actions/checkout → v6.0.2
  • actions/upload-artifact → v7.0.0
  • actions/download-artifact → v4.3.0

actions/checkout is bumped from v5 to v6 at the same time. v6 stores the git credentials outside the working tree, so it can no longer be picked up by subsequent actions/upload-artifact steps (see "artipacked" link below).

See https://docs.zizmor.sh/audits/#unpinned-uses and https://docs.zizmor.sh/audits/#artipacked

Pin all third-party actions to immutable commit SHAs, with the
resolved version tag in a trailing comment. This prevents upstream
tags from silently changing under us.

- actions/checkout          → v6.0.2
- actions/upload-artifact   → v7.0.0
- actions/download-artifact → v4.3.0

`actions/checkout` is bumped from v5 to v6 at the same time. v6
stores the git credentials outside the working tree, so it can no
longer be picked up by subsequent `actions/upload-artifact` steps.

See https://docs.zizmor.sh/audits/#unpinned-uses
and https://docs.zizmor.sh/audits/#artipacked
@rustbot rustbot added A-CI Area: Our Github Actions CI S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Apr 10, 2026
@rustbot

rustbot commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

r? @jdno

rustbot has assigned @jdno.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: infra-ci
  • infra-ci expanded to Kobzol, Mark-Simulacrum, jdno, jieyouxu, marcoieni
  • Random selection from Mark-Simulacrum, jdno, marcoieni

@bjorn3

bjorn3 commented Apr 10, 2026

Copy link
Copy Markdown
Member

I'm surprised official github actions don't use immutable releases yet.

@Turbo87

Turbo87 commented Apr 10, 2026

Copy link
Copy Markdown
Member Author

yeah, same, but unfortunately that seems to be the case. once they switch to immutable releases we can consider going back, although we would then still need to use the full version tags (v1.2.3 instead of v1) to take advantage.

@Turbo87

Turbo87 commented Apr 16, 2026

Copy link
Copy Markdown
Member Author

r? @marcoieni

@rustbot rustbot assigned marcoieni and unassigned jdno Apr 16, 2026
@marcoieni

Copy link
Copy Markdown
Member

I think it's better to setup renovate and let it do this job. Otherwise we need to update these actions manually after we merge this. Or worse, these actions don't get updated.

@marcoieni

marcoieni commented Apr 16, 2026

Copy link
Copy Markdown
Member

At the moment renovate isn't enabled in this repo.

So we should

  1. enable forking-renovate for this repo in the team repo
  2. Change https://github.com/rust-lang/rust/blob/main/.github/renovate.json5 to only update github actions

Wdyt?

@Turbo87

Turbo87 commented Apr 30, 2026

Copy link
Copy Markdown
Member Author

Wdyt?

sounds good to me, but at least the first step requires permissions that I don't have :D

@marcoieni

Copy link
Copy Markdown
Member

@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #157586) made this pull request unmergeable. Please resolve the merge conflicts.

Turbo87 added a commit to Turbo87/rust that referenced this pull request Jun 16, 2026
Pins GitHub Actions to their commit SHA digests and keeps them updated.
This lets Renovate handle the pinning that was proposed in
rust-lang#155089 instead of maintaining it
manually.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 16, 2026
Configure Renovate for GitHub Actions

This sets up Renovate to keep our GitHub Actions pinned to commit SHAs and up to date, as a follow-up to rust-lang#155089 where we pinned them by hand. The actual pinning is handled by the `helpers:pinGitHubActionDigests` preset.

For now every update has to be approved from the Dependency Dashboard before Renovate opens a PR. I expect this to be temporary while we get the config right, since it lets us preview what Renovate wants to do without flooding the PR list. Once the pinning and the update PRs look correct, we can drop the approval requirement for the github-actions manager and let those flow through automatically.

Renovate also skips the subtree paths, since those tools are maintained in their own repositories and synced back in, and rust-lang#134127 showed what happens when it starts editing them directly. The lockfile maintenance job is gone as well, since it was broken anyway.

r? @marcoieni
renovate-bot pushed a commit to renovate-bot/rust-lang-_-team that referenced this pull request Jun 17, 2026
This enables Renovate to pin GitHub Actions to SHAs and keep them up-to-date.

See rust-lang/rust#155089 (comment)
makai410 pushed a commit to makai410/rust that referenced this pull request Jun 17, 2026
Pins GitHub Actions to their commit SHA digests and keeps them updated.
This lets Renovate handle the pinning that was proposed in
rust-lang#155089 instead of maintaining it
manually.
@Turbo87

Turbo87 commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

closing in favor of #158007

@Turbo87 Turbo87 closed this Jun 18, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 18, 2026
@Turbo87 Turbo87 deleted the pin-github-actions branch June 18, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants