ci: harden action pinning lint (#1545)
* ci: harden action pinning lint * refactor: extract dockview review dialog slot * test: cover action pinning edge cases * fix: reject dynamic workflow action sources * fix: normalize quoted workflow action refs * test: cover quoted unpinned action refs --------- Co-authored-by: root <root@kandev.ts.net>
This commit is contained in:
@@ -94,7 +94,7 @@ function findPnpmSetupVersion(
|
||||
}
|
||||
|
||||
function matchPnpmSetupUsesLine(line: string): RegExpMatchArray | null {
|
||||
return line.match(/^(\s*)(?:-\s*)?uses:\s*["']?pnpm\/action-setup@v\d+["']?\s*(?:#.*)?$/);
|
||||
return line.match(/^(\s*)(?:-\s*)?uses:\s*["']?pnpm\/action-setup@[0-9a-f]{40}["']?\s*(?:#.*)?$/);
|
||||
}
|
||||
|
||||
function findStepIndent(lines: string[], usesLineIndex: number, usesIndent: number): number {
|
||||
@@ -233,7 +233,7 @@ describe("release desktop artifacts", () => {
|
||||
expect(workflow).toContain(
|
||||
'rustup toolchain install stable --profile minimal --target "${{ matrix.rust_target }}"',
|
||||
);
|
||||
expect(workflow).toContain("Swatinem/rust-cache@v2");
|
||||
expect(workflow).toMatch(/Swatinem\/rust-cache@[0-9a-f]{40}\s+# v2/);
|
||||
|
||||
for (const platform of desktopPlatforms) {
|
||||
expect(workflow, `release.yml must include desktop platform ${platform}`).toContain(
|
||||
|
||||
Reference in New Issue
Block a user