Skip to content

Commit 7e36609

Browse files
[skip ci]Update actions/cache action to v6 (#14)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent 9ca70f5 commit 7e36609

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

.github/workflows/desktop-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
uses: dtolnay/rust-toolchain@stable
6161

6262
- name: Restore Rust build cache
63-
uses: actions/cache@v5
63+
uses: actions/cache@v6
6464
with:
6565
path: |
6666
~/.cargo/registry

scripts/check-desktop-nightly-workflow.mjs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ const requiredSnippets = [
1515
["manual trigger", "workflow_dispatch:"],
1616
["scheduled trigger", "schedule:"],
1717
["release write permission", "contents: write"],
18-
["Node 24 cache action", "actions/cache@v5"],
1918
["Windows runner", "windows-latest"],
2019
["macOS Apple Silicon runner", "macos-15"],
2120
["macOS arm64 guard", 'test "$(uname -m)" = "arm64"'],
@@ -37,8 +36,19 @@ for (const [label, snippet] of requiredSnippets) {
3736
}
3837
}
3938

40-
if (workflow.includes("actions/cache@v4")) {
41-
fail("Desktop nightly workflow still uses actions/cache@v4, which targets the deprecated Node.js 20 runtime");
39+
const cacheActionVersions = Array.from(
40+
workflow.matchAll(/uses:\s+actions\/cache@v(\d+)(?:\s|$)/g),
41+
(match) => Number(match[1]),
42+
);
43+
44+
if (cacheActionVersions.length === 0) {
45+
fail("Desktop nightly workflow missing Node 24-compatible cache action: actions/cache@v5 or newer");
46+
}
47+
48+
const unsupportedCacheVersions = cacheActionVersions.filter((version) => version < 5);
49+
if (unsupportedCacheVersions.length > 0) {
50+
const versions = unsupportedCacheVersions.map((version) => `v${version}`).join(", ");
51+
fail(`Desktop nightly workflow uses unsupported actions/cache version(s): ${versions}`);
4252
}
4353

4454
console.log("Checked desktop nightly workflow");

0 commit comments

Comments
 (0)