@@ -17,9 +17,8 @@ those changes are properly synced back to the source templates. Regular workflow
1717files are updated directly by Dependabot and don't need sync-back.
1818*/
1919
20- import { parseArgs } from "node:util" ;
21-
2220import * as fs from "fs" ;
21+ import { parseArgs } from "node:util" ;
2322import * as path from "path" ;
2423
2524const THIS_DIR = __dirname ;
@@ -33,7 +32,9 @@ const SYNC_TS_PATH = path.join(THIS_DIR, "sync.ts");
3332 * @param workflowDir - Path to .github/workflows directory
3433 * @returns Map from action names to their latest versions (including comments)
3534 */
36- export function scanGeneratedWorkflows ( workflowDir : string ) : Record < string , string > {
35+ export function scanGeneratedWorkflows (
36+ workflowDir : string ,
37+ ) : Record < string , string > {
3738 const actionVersions : Record < string , string > = { } ;
3839
3940 const generatedFiles = fs
@@ -96,10 +97,7 @@ export function updateSyncTs(
9697 // variable - that's a risk we're happy to take since in that case the
9798 // PR checks will just fail.
9899 const escaped = actionName . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, "\\$&" ) ;
99- const pattern = new RegExp (
100- `(uses:\\s*")${ escaped } @(?:[^"]+)(")` ,
101- "g" ,
102- ) ;
100+ const pattern = new RegExp ( `(uses:\\s*")${ escaped } @(?:[^"]+)(")` , "g" ) ;
103101 content = content . replace ( pattern , `$1${ actionName } @${ version } $2` ) ;
104102 }
105103
@@ -141,10 +139,7 @@ export function updateTemplateFiles(
141139 ) ) {
142140 // Look for patterns like 'uses: actions/setup-node@v4' or 'uses: actions/setup-node@sha # comment'
143141 const escaped = actionName . replace ( / [ . * + ? ^ $ { } ( ) | [ \] \\ ] / g, "\\$&" ) ;
144- const pattern = new RegExp (
145- `(uses:\\s+${ escaped } )@(?:[^@\n]+)` ,
146- "g" ,
147- ) ;
142+ const pattern = new RegExp ( `(uses:\\s+${ escaped } )@(?:[^@\n]+)` , "g" ) ;
148143 content = content . replace ( pattern , `$1@${ versionWithComment } ` ) ;
149144 }
150145
0 commit comments