@@ -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 ( / u s e s : \s + a c t i o n s \/ c a c h e @ 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
4454console . log ( "Checked desktop nightly workflow" ) ;
0 commit comments