Skip to content

fix: automerge workflow event condition#931

Merged
JohnMcLear merged 1 commit intomainfrom
fix/automerge-event-condition
Apr 15, 2026
Merged

fix: automerge workflow event condition#931
JohnMcLear merged 1 commit intomainfrom
fix/automerge-event-condition

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Summary

  • The automerge workflow checks github.event.workflow_run.event == 'pull_request', but the Node.js Package workflow triggers on push events
  • This means the automerge condition is never satisfied and dependabot PRs are never auto-merged
  • Fix: change the condition to check for push instead of pull_request

Test plan

  • Verify automerge workflow runs are no longer skipped when dependabot PRs pass CI

Generated with Claude Code

The test workflow (Node.js Package) triggers on push events, but the
automerge condition checked for pull_request events, causing it to
always skip. Fix the condition to match the actual event type.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Fix automerge workflow event condition for dependabot

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Fix automerge workflow event condition from pull_request to push
• Aligns condition with actual Node.js Package workflow trigger event
• Enables dependabot PRs to be auto-merged when CI passes
Diagram
flowchart LR
  A["Automerge Workflow"] -->|checks event type| B["Event Condition"]
  B -->|was checking| C["pull_request"]
  B -->|now checks| D["push"]
  D -->|matches| E["Node.js Package Workflow trigger"]
Loading

Grey Divider

File Changes

1. .github/workflows/automerge.yml 🐞 Bug fix +1/-1

Update automerge event condition to push

• Changed workflow event condition from pull_request to push
• Fixes mismatch between automerge trigger condition and actual Node.js Package workflow event type
• Allows dependabot PRs to be auto-merged when CI passes successfully

.github/workflows/automerge.yml


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects Bot commented Apr 15, 2026

Code Review by Qodo

🐞 Bugs (1)   📘 Rule violations (0)   📎 Requirement gaps (0)
🐞\ ≡ Correctness (1)

Grey Divider


Action required

1. Automerge event filter wrong 🐞
Description
Dependabot Automerge now requires github.event.workflow_run.event == 'push', but it is triggered
by completed runs of the CI workflow which runs on pull_request; this will skip successful
Dependabot PR CI runs. This prevents the automerge job from running in the scenario it’s meant to
handle (Dependabot PRs passing CI).
Code

.github/workflows/automerge.yml[R14-17]

    if: >
      github.event.workflow_run.conclusion == 'success' &&
-      github.event.workflow_run.event == 'pull_request' &&
+      github.event.workflow_run.event == 'push' &&
      github.event.workflow_run.actor.login == 'dependabot[bot]'
Evidence
The automerge workflow listens to workflow_run events for workflow CI. The CI workflow is
explicitly triggered on pull_request, so for a PR CI run the workflow_run.event value will be
pull_request. Changing the automerge predicate to require push therefore filters out the CI runs
created for PRs (including Dependabot PRs), so the automerge job won’t execute after PR CI success.

.github/workflows/automerge.yml[5-17]
.github/workflows/ci.yml[1-7]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`automerge.yml` filters `workflow_run` events to `event == 'push'`, but the monitored workflow (`CI`) runs for `pull_request` events as well. This prevents the automerge job from running after successful PR CI runs.

### Issue Context
`Dependabot Automerge` is triggered by `workflow_run` of the `CI` workflow. Since `CI` runs on `pull_request`, the automerge workflow must allow `workflow_run.event == 'pull_request'` (or allow both `pull_request` and `push` if you intentionally want both).

### Fix Focus Areas
- .github/workflows/automerge.yml[14-17]

### Concrete fix
Update the `if:` condition to match the intended trigger, e.g.:
- Revert to `github.event.workflow_run.event == 'pull_request'`, **or**
- Allow both: `contains(fromJson('["pull_request","push"]'), github.event.workflow_run.event)` (only if you truly want automerge to run for both kinds of CI runs).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines 14 to 17
if: >
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.actor.login == 'dependabot[bot]'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Automerge event filter wrong 🐞 Bug ≡ Correctness

Dependabot Automerge now requires github.event.workflow_run.event == 'push', but it is triggered
by completed runs of the CI workflow which runs on pull_request; this will skip successful
Dependabot PR CI runs. This prevents the automerge job from running in the scenario it’s meant to
handle (Dependabot PRs passing CI).
Agent Prompt
### Issue description
`automerge.yml` filters `workflow_run` events to `event == 'push'`, but the monitored workflow (`CI`) runs for `pull_request` events as well. This prevents the automerge job from running after successful PR CI runs.

### Issue Context
`Dependabot Automerge` is triggered by `workflow_run` of the `CI` workflow. Since `CI` runs on `pull_request`, the automerge workflow must allow `workflow_run.event == 'pull_request'` (or allow both `pull_request` and `push` if you intentionally want both).

### Fix Focus Areas
- .github/workflows/automerge.yml[14-17]

### Concrete fix
Update the `if:` condition to match the intended trigger, e.g.:
- Revert to `github.event.workflow_run.event == 'pull_request'`, **or**
- Allow both: `contains(fromJson('["pull_request","push"]'), github.event.workflow_run.event)` (only if you truly want automerge to run for both kinds of CI runs).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@JohnMcLear JohnMcLear merged commit 1246bce into main Apr 15, 2026
12 checks passed
@JohnMcLear JohnMcLear deleted the fix/automerge-event-condition branch April 15, 2026 08:45
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