Skip to content

Commit 3768f9c

Browse files
authored
Instruct Renovate to pin GitHub Actions based on SHA (#16789)
## Summary The intent here is that all actions should be pinned to an immutable SHA (but that Renovate should annotate each SHA with the corresponding SemVer version). See astral-sh/uv#12189 ## Test plan ``` npx --yes --package renovate -- renovate-config-validator npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported INFO: Validating .github/renovate.json5 INFO: Config validated successfully ```
1 parent 01f3ef4 commit 3768f9c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

.github/renovate.json5

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@
4040
enabled: true,
4141
},
4242
packageRules: [
43+
// Pin GitHub Actions to immutable SHAs.
44+
{
45+
matchDepTypes: ["action"],
46+
pinDigests: true,
47+
},
48+
// Annotate GitHub Actions SHAs with a SemVer version.
49+
{
50+
extends: ["helpers:pinGitHubActionDigests"],
51+
extractVersion: "^(?<version>v?\\d+\\.\\d+\\.\\d+)$",
52+
versioning: "regex:^v?(?<major>\\d+)(\\.(?<minor>\\d+)\\.(?<patch>\\d+))?$",
53+
},
4354
{
4455
// Group upload/download artifact updates, the versions are dependent
4556
groupName: "Artifact GitHub Actions dependencies",

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name: CI
22

3-
permissions: { }
3+
permissions: {}
44

55
on:
66
push:
7-
branches: [ main ]
7+
branches: [main]
88
pull_request:
99
workflow_dispatch:
1010

0 commit comments

Comments
 (0)