@@ -4,6 +4,11 @@ import { parse } from "yaml";
|
4 | 4 | |
5 | 5 | const WORKFLOW = ".github/workflows/dependency-guard.yml"; |
6 | 6 | const CODEOWNERS = ".github/CODEOWNERS"; |
| 7 | +const BACKFILL_EXCLUDED_WORKFLOWS = [ |
| 8 | +[".github/workflows/auto-response.yml", "auto-response"], |
| 9 | +[".github/workflows/clawsweeper-dispatch.yml", "dispatch"], |
| 10 | +[".github/workflows/real-behavior-proof.yml", "real-behavior-proof"], |
| 11 | +]; |
7 | 12 | |
8 | 13 | type WorkflowStep = { |
9 | 14 | name?: string; |
@@ -33,6 +38,10 @@ function readWorkflow(): Workflow {
|
33 | 38 | return parse(readFileSync(WORKFLOW, "utf8")) as Workflow; |
34 | 39 | } |
35 | 40 | |
| 41 | +function readWorkflowFile(path: string): Workflow { |
| 42 | +return parse(readFileSync(path, "utf8")) as Workflow; |
| 43 | +} |
| 44 | + |
36 | 45 | describe("dependency guard workflow", () => { |
37 | 46 | it("uses the dependency guard check name", () => { |
38 | 47 | const parsed = readWorkflow(); |
@@ -57,6 +66,16 @@ describe("dependency guard workflow", () => {
|
57 | 66 | expect(job?.if).toContain("github.event.label.name == 'dependency-guard-backfill'"); |
58 | 67 | }); |
59 | 68 | |
| 69 | +it("keeps the temporary backfill label from waking unrelated PR automation", () => { |
| 70 | +for (const [workflowFile, jobName] of BACKFILL_EXCLUDED_WORKFLOWS) { |
| 71 | +const job = readWorkflowFile(workflowFile).jobs?.[jobName]; |
| 72 | + |
| 73 | +expect(job?.if).toContain("github.event.action == 'labeled'"); |
| 74 | +expect(job?.if).toContain("github.event.action == 'unlabeled'"); |
| 75 | +expect(job?.if).toContain("github.event.label.name == 'dependency-guard-backfill'"); |
| 76 | +} |
| 77 | +}); |
| 78 | + |
60 | 79 | it("uses a metadata-only pull_request_target workflow with minimal write permissions", () => { |
61 | 80 | const workflow = readFileSync(WORKFLOW, "utf8"); |
62 | 81 | const parsed = readWorkflow(); |
|