fix: automerge workflow event condition#931
Merged
JohnMcLear merged 1 commit intomainfrom Apr 15, 2026
Merged
Conversation
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>
Review Summary by QodoFix automerge workflow event condition for dependabot
WalkthroughsDescription• 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 Diagramflowchart 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"]
File Changes1. .github/workflows/automerge.yml
|
Code Review by Qodo
|
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]' |
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
github.event.workflow_run.event == 'pull_request', but the Node.js Package workflow triggers onpusheventspushinstead ofpull_requestTest plan
Generated with Claude Code