Skip to content

Commit b171c1c

Browse files
committed
Fix linter errors in sync-back.ts
1 parent 967ca85 commit b171c1c

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

pr-checks/sync-back.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ those changes are properly synced back to the source templates. Regular workflow
1717
files are updated directly by Dependabot and don't need sync-back.
1818
*/
1919

20-
import { parseArgs } from "node:util";
21-
2220
import * as fs from "fs";
21+
import { parseArgs } from "node:util";
2322
import * as path from "path";
2423

2524
const 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

Comments
 (0)