Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/desktop-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable

- name: Restore Rust build cache
uses: actions/cache@v5
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
Expand Down
16 changes: 13 additions & 3 deletions scripts/check-desktop-nightly-workflow.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const requiredSnippets = [
["manual trigger", "workflow_dispatch:"],
["scheduled trigger", "schedule:"],
["release write permission", "contents: write"],
["Node 24 cache action", "actions/cache@v5"],
["Windows runner", "windows-latest"],
["macOS Apple Silicon runner", "macos-15"],
["macOS arm64 guard", 'test "$(uname -m)" = "arm64"'],
Expand All @@ -37,8 +36,19 @@ for (const [label, snippet] of requiredSnippets) {
}
}

if (workflow.includes("actions/cache@v4")) {
fail("Desktop nightly workflow still uses actions/cache@v4, which targets the deprecated Node.js 20 runtime");
const cacheActionVersions = Array.from(
workflow.matchAll(/uses:\s+actions\/cache@v(\d+)(?:\s|$)/g),
(match) => Number(match[1]),
);

if (cacheActionVersions.length === 0) {
fail("Desktop nightly workflow missing Node 24-compatible cache action: actions/cache@v5 or newer");
}

const unsupportedCacheVersions = cacheActionVersions.filter((version) => version < 5);
if (unsupportedCacheVersions.length > 0) {
const versions = unsupportedCacheVersions.map((version) => `v${version}`).join(", ");
fail(`Desktop nightly workflow uses unsupported actions/cache version(s): ${versions}`);
}

console.log("Checked desktop nightly workflow");
Expand Down