Skip to content

Commit 272b88b

Browse files
chore: sync workflow templates (#81)
* chore: sync workflow templates from Workflows repo Automated sync from stranske/Workflows Template hash: 55d3edda53dc Changes synced from sync-manifest.yml * chore(autofix): formatting/lint --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 584b61e commit 272b88b

1 file changed

Lines changed: 51 additions & 5 deletions

File tree

.github/workflows/agents-verifier.yml

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Thin caller for Agents Verifier - delegates to Workflows repo reusable workflow
2-
# Runs post-merge to verify acceptance criteria were met and opens follow-up issues
2+
# Verifies acceptance criteria were met and opens follow-up issues if not
33
#
44
# Triggers:
5-
# - PR merged (pull_request_target closed with merged=true)
5+
# - Label 'verify:checkbox' added to merged PR (opt-in checkbox verification)
6+
# - Label 'verify:evaluate' added to merged PR (future: LLM evaluation)
7+
# - Label 'verify:compare' added to merged PR (compare-based verification)
8+
# Note: No longer runs automatically on every merge. Add a verify:* label to trigger.
69
#
710
# Required secrets (via secrets: inherit):
811
# - CODEX_AUTH_JSON: Authentication for Codex API
@@ -15,7 +18,7 @@ name: Agents Verifier
1518
on:
1619
pull_request_target:
1720
types:
18-
- closed
21+
- labeled
1922

2023
permissions:
2124
contents: read
@@ -24,11 +27,54 @@ permissions:
2427
actions: read
2528

2629
jobs:
30+
# Gate: only proceed if PR is merged AND has verify:* label
31+
check:
32+
runs-on: ubuntu-latest
33+
outputs:
34+
should_run: ${{ steps.check.outputs.should_run }}
35+
mode: ${{ steps.check.outputs.mode }}
36+
steps:
37+
- name: Check trigger conditions
38+
id: check
39+
uses: actions/github-script@v8
40+
with:
41+
script: |
42+
const pr = context.payload.pull_request;
43+
const label = context.payload.label;
44+
45+
// Must be a merged PR
46+
if (!pr || !pr.merged) {
47+
core.info('PR not merged; skipping verifier.');
48+
core.setOutput('should_run', 'false');
49+
return;
50+
}
51+
52+
// Must be a verify:* label
53+
const labelName = label?.name || '';
54+
const verifyModes = {
55+
'verify:checkbox': 'checkbox',
56+
'verify:evaluate': 'evaluate',
57+
'verify:compare': 'compare',
58+
};
59+
60+
const mode = verifyModes[labelName];
61+
if (!mode) {
62+
core.info(`Label '${labelName}' is not a verify trigger; skipping.`);
63+
core.setOutput('should_run', 'false');
64+
return;
65+
}
66+
67+
core.info(`Verifier triggered with mode: ${mode}`);
68+
core.setOutput('should_run', 'true');
69+
core.setOutput('mode', mode);
70+
2771
verifier:
28-
# Only run on merged PRs
29-
if: github.event.pull_request.merged == true
72+
needs: check
73+
if: needs.check.outputs.should_run == 'true'
3074
uses: stranske/Workflows/.github/workflows/reusable-agents-verifier.yml@main
3175
with:
3276
# CI workflows to wait for before running verifier
3377
ci_workflows: '["ci.yml", "pr-00-gate.yml"]'
78+
# Verification mode from label
79+
mode: ${{ needs.check.outputs.mode }}
3480
secrets: inherit

0 commit comments

Comments
 (0)