Skip to content

Commit a1aadff

Browse files
committed
fix(ci): stop label-driven automation churn
1 parent 74014c2 commit a1aadff

3 files changed

Lines changed: 62 additions & 8 deletions

File tree

‎.github/workflows/auto-response.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@ env:
1212
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
1313

1414
concurrency:
15-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
16-
cancel-in-progress: ${{ github.event_name == 'pull_request_target' }}
15+
group: ${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number }}
16+
cancel-in-progress: ${{ github.event_name == 'pull_request_target' && github.event.action == 'synchronize' }}
1717

1818
permissions: {}
1919

2020
jobs:
2121
auto-response:
22+
if: >-
23+
${{
24+
github.event_name != 'pull_request_target' ||
25+
(github.event.action != 'labeled' && github.event.action != 'unlabeled') ||
26+
(github.actor != 'clawsweeper[bot]' && github.actor != 'openclaw-clawsweeper[bot]')
27+
}}
2228
permissions:
2329
contents: read
2430
issues: write

‎.github/workflows/real-behavior-proof.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: Real behavior proof
1+
name: PR context and evidence
22

33
on:
44
pull_request_target: # zizmor: ignore[dangerous-triggers] trusted base checkout only; no untrusted PR code execution
5-
types: [opened, edited, synchronize, reopened, ready_for_review, labeled, unlabeled]
5+
types: [opened, edited, synchronize, reopened, ready_for_review]
66

77
env:
88
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
99

1010
concurrency:
11-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
12-
cancel-in-progress: true
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
12+
cancel-in-progress: ${{ github.event.action == 'synchronize' }}
1313

1414
permissions: {}
1515

1616
jobs:
1717
real-behavior-proof:
18-
name: Real behavior proof
18+
name: PR context and evidence
1919
if: >-
2020
${{
2121
github.event.action != 'edited' ||
@@ -51,7 +51,7 @@ jobs:
5151
private-key: ${{ secrets.GH_APP_PRIVATE_KEY_FALLBACK }}
5252
permission-issues: read
5353
permission-members: read
54-
- name: Check real behavior proof
54+
- name: Check PR context and evidence
5555
env:
5656
GH_APP_TOKEN: ${{ steps.app-token.outputs.token || steps.app-token-fallback.outputs.token }}
5757
GITHUB_TOKEN: ${{ github.token }}

‎test/scripts/ci-workflow-guards.test.ts‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,54 @@ describe("ci workflow guards", () => {
900900
});
901901
});
902902

903+
it("runs the PR context and evidence gate only for relevant PR changes", () => {
904+
const workflow = readRealBehaviorProofWorkflow();
905+
906+
expect(workflow.name).toBe("PR context and evidence");
907+
expect(workflow.jobs["real-behavior-proof"].name).toBe("PR context and evidence");
908+
expect(workflow.on.pull_request_target.types).toEqual([
909+
"opened",
910+
"edited",
911+
"synchronize",
912+
"reopened",
913+
"ready_for_review",
914+
]);
915+
expect(workflow.concurrency.group).toBe(
916+
"${{ github.workflow }}-${{ github.event.pull_request.number }}",
917+
);
918+
expect(workflow.concurrency["cancel-in-progress"]).toBe(
919+
"${{ github.event.action == 'synchronize' }}",
920+
);
921+
});
922+
923+
it("isolates auto-response per item and ignores ClawSweeper PR label feedback", () => {
924+
const workflow = readWorkflow(".github/workflows/auto-response.yml");
925+
const guard = workflow.jobs["auto-response"].if;
926+
927+
expect(workflow.on.issues.types).toEqual(["opened", "edited", "labeled"]);
928+
expect(workflow.on.issue_comment.types).toEqual(["created"]);
929+
expect(workflow.on.pull_request_target.types).toEqual([
930+
"opened",
931+
"edited",
932+
"synchronize",
933+
"reopened",
934+
"labeled",
935+
"unlabeled",
936+
]);
937+
expect(workflow.concurrency.group).toBe(
938+
"${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number }}",
939+
);
940+
expect(workflow.concurrency["cancel-in-progress"]).toBe(
941+
"${{ github.event_name == 'pull_request_target' && github.event.action == 'synchronize' }}",
942+
);
943+
expect(guard).toContain("github.event_name != 'pull_request_target'");
944+
expect(guard).toContain("github.event.action != 'labeled'");
945+
expect(guard).toContain("github.event.action != 'unlabeled'");
946+
expect(guard).toContain("github.actor != 'clawsweeper[bot]'");
947+
expect(guard).toContain("github.actor != 'openclaw-clawsweeper[bot]'");
948+
expect(guard).not.toContain("openclaw-barnacle[bot]");
949+
});
950+
903951
it("routes stale bug issues through ClawSweeper instead of Barnacle closure", () => {
904952
const staleWorkflow = readWorkflow(".github/workflows/stale.yml");
905953
const staleSteps = staleWorkflow.jobs.stale.steps as WorkflowStep[];

0 commit comments

Comments
 (0)