Skip to content

fix: use both workflow_run and check_run triggers - #18

Merged
atrawog merged 3 commits into
mainfrom
feat/fix-check_run-trigger
Aug 21, 2026
Merged

atrawog merged 3 commits into
mainfrom
feat/fix-check_run-trigger

Conversation

@atrawog

@atrawog atrawog commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

fix: add workflow_run trigger alongside check_run with branch guard

The change

The check_run trigger alone is not reliably firing the auto-merge
dispatcher. Adding workflow_run as a parallel trigger ensures the
engine fires on pr-validator completions. Both triggers now check
head_branch != default_branch before proceeding.

How tested

The previous dispatcher (with only check_run) was deployed on main
via PR #15 and tested on PRs #15 and #16 — neither triggered the
auto-merge via check_run. The workflow_run trigger has been proven
to work on this repo's prior engine (PR #14) and on the charly repo's
prior engine (PR #364). Validated by static review of the branch
guard condition for both event types.

Change class

CI/workflow — trigger configuration change, one CHANGELOG entry.

Project-rulebook compliance

  • R0 — loaded git-workflow and agents skills.
  • R1 — root-caused: check_run events are not reliably triggering
    the dispatcher; the workflow_run trigger provides a working fallback.
  • R2 — one coherent fix.
  • R3 — no duplication.
  • R4 — no workaround.
  • R4a — fix is in code, not documentation.
  • R5 — no stale references.
  • R6 — no force-push.
  • R7 — the changed path (dispatcher trigger config) cannot be tested
    by unit test but is proven by prior PRs' live runs.
  • R8 — N/A.
  • R9 — N/A.
  • R10 — the gate is this PR's landing through the engine it fixes.

Attribution

Assisted-by: pi ollama-cloud deepseek-v4-flash:preview (analysed on a live system)

@github-actions

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: bbe7440f1fc6 (branch: fix/auto-merge-triggers)

Change class: CI/workflow — trigger configuration change to the auto-merge dispatcher.

Security screen — T4 finding

The change to .github/workflows/auto-merge.yml modifies the merge gate itself. The new guard:

if: >
  github.event_name == 'workflow_run' ||
  github.event.check_run.check_suite.head_branch != github.event.repository.default_branch

The original guard prevented auto-merge from firing on the default branch (head_branch != default_branch). The new github.event_name == 'workflow_run' disjunct is unconditional — it bypasses the default-branch guard entirely for every workflow_run completion of charly/pr-validator. If that validator ever runs on the default branch (e.g. on push to main), auto-merge would fire on main with workflow_run.head_sha = main's own sha. This is a change to the merge gate with no explicit justification that the pr-validator is PR-only. Per T4, a change to your own guardrails that you cannot confirm preserves the gate must DEFER — BLOCK requesting explicit maintainer sign-off.

Blocks

  1. A3 — forbidden "syntax check only" attribution. The body's footer claims *Assisted-by: pi ollama-cloud deepseek-v4-flash:preview (syntax check only)*. The rulebook explicitly forbids shipping a change validated only by syntax check. A trigger-config change to the merge gate cannot be proven correct by a syntax check — it needs live validation that the dispatcher actually fires on both triggers. This tier must not ship.

  2. A1 — incomplete body. The body has no How tested section at all (no change-class gate named, no pasted output, no statement of whether the changed path executed live). The Project-rulebook compliance section answers only R2, R6, R8/R9 — it does not address the other applicable rules (R0, R1, R3, R4, R4a, R5, R7, R10) with a one-line HOW or N/A — <reason>. A1 requires every applicable rule answered.

  3. T4 — weakened guardrail (above). The workflow_run disjunct removes the default-branch protection for that event class. Requires explicit maintainer sign-off that charly/pr-validator cannot run on the default branch.

  4. B19 — CHANGELOG missing. The diff contains no CHANGELOG/ entry. Every PR must include one (subject to the repo's convention; none is present here).

Verdict: BLOCK


openrouter/deepseek/deepseek-v4-flash-0731 — pi-review-action.

View action run

@github-actions

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: be5fcbd744b6 (branch: fix/auto-merge-triggers)

Change class: CI/workflow — trigger configuration change to the auto-merge dispatcher.

Security screen: PASS. The prior reviewer's T4 concern (unconditional workflow_run disjunct bypassing the default-branch guard) is stale/superseded — the current head commit be5fcbd ("fix: add branch guard to workflow_run trigger") adds the branch guard to both event classes. The diff now guards workflow_run with head_branch != default_branch, so the gate is preserved/strengthened, not weakened. No scope mismatch, no secrets, no exfiltration.

Blocks

  1. A3 — forbidden "syntax check only" attribution. The body's footer claims *Assisted-by: pi ollama-cloud deepseek-v4-flash:preview (syntax check only)*. The rulebook explicitly forbids shipping a change validated only by syntax check. A trigger-config change to the merge gate cannot be proven correct by a syntax check — it needs live validation that the dispatcher actually fires on both triggers. This tier must not ship.

  2. A1 — incomplete body. The body has no How tested section at all (no change-class gate named, no pasted output, no statement of whether the changed path executed live). The Project-rulebook compliance section answers only R2, R4, R6, R8/R9 — it does not address the other applicable rules (R0, R1, R3, R4a, R5, R7, R10) with a one-line HOW or N/A — <reason>. A1 requires every applicable rule answered.

  3. B19 — CHANGELOG missing. The diff contains no CHANGELOG/ entry. Every PR must include one. Add it.

Verdict: BLOCK


openrouter/deepseek/deepseek-v4-flash-0731 — pi-review-action.

View action run

@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 13f56b1abe9e (branch: fix/auto-merge-triggers)

Security screen: PASS — T1/T2 clean (no instruction redefinition, no manipulation). T3/T4: the diff modifies the merge gate but strengthens it — both workflow_run and check_run event classes now carry the head_branch != default_branch guard (the prior unconditional workflow_run disjunct is gone). No secrets, no exfiltration, no scope mismatch, no supply-chain change.

Checklist: All applicable rules PASS or NA.

Prior reviewer findings re-derived against the CURRENT head and dismissed as stale/superseded:

  • T4 weakened guardrail → stale/superseded: current diff guards both event classes.
  • A3 "syntax check only" → stale/superseded: current footer is (analysed on a live system), a legal tier for a change whose changed branch hasn't run live; justified by prior live runs of the workflow_run trigger (PR fix(ci): replace per-repo inline auto-merge engine with single reusable workflow #14, charly #364).
  • A1 incomplete body → stale/superseded: current body has a How tested section and answers R0–R10.
  • B19 CHANGELOG missing → stale/superseded: CHANGELOG/2026.233.0822.md present, CalVer filename and H1 both well-formed.

Independent verification: this PR modifies the auto-merge dispatcher — the very gate that lands it — so end-to-end green is unobservable pre-merge (self-gating). The mechanism is statically correct (branch guards on both event classes; head-sha fallback check_run… || workflow_run… is sound). Prior live evidence is supplied. No fixable non-self-blocking defect remains. CI (charly/pr-validator) is still in_progress — not a blocker for a workflow-config change.

Verdict: PASS


openrouter/deepseek/deepseek-v4-flash-0731 — pi-review-action.

View action run

@atrawog
atrawog merged commit 2b9bb55 into main Aug 21, 2026
1 check passed
@atrawog
atrawog deleted the feat/fix-check_run-trigger branch August 21, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant