Skip to content

chore(automerge): remove check_suite if-condition on automerge job#26

Merged
lirantal merged 1 commit intomainfrom
chore/automerge-remove-check-suite-if
May 1, 2026
Merged

chore(automerge): remove check_suite if-condition on automerge job#26
lirantal merged 1 commit intomainfrom
chore/automerge-remove-check-suite-if

Conversation

@lirantal
Copy link
Copy Markdown
Owner

@lirantal lirantal commented May 1, 2026

Removes the if: block on the automerge job that conditioned on check_suite events. The condition was a workaround for an older github-actions behavior and is no longer necessary — the workflow now runs unconditionally on its triggering events.

 jobs:
   automerge:
     runs-on: ubuntu-latest
-    if: >
-      github.event_name != 'check_suite' ||
-      github.event.check_suite.pull_requests[0] != null
     permissions:
       contents: write
       pull-requests: write

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Remove check_suite if-condition from automerge workflow

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Removes obsolete check_suite event condition from automerge job
• Simplifies workflow by eliminating workaround for legacy GitHub Actions behavior
• Job now runs unconditionally on all configured trigger events
Diagram
flowchart LR
  A["automerge job"] -->|"removes conditional logic"| B["Runs on all trigger events"]
  C["check_suite event"] -->|"no longer filtered"| B
Loading

Grey Divider

File Changes

1. .github/workflows/automerge.yml ⚙️ Configuration changes +0/-3

Remove obsolete check_suite conditional logic

• Removes the if: conditional block that checked for check_suite events
• Eliminates the condition `github.event_name != 'check_suite' ||
 github.event.check_suite.pull_requests[0] != null`
• Job now executes unconditionally on pull_request_review and check_suite trigger events

.github/workflows/automerge.yml


Grey Divider

Qodo Logo

@github-actions github-actions Bot added the build label May 1, 2026
@qodo-code-review
Copy link
Copy Markdown

qodo-code-review Bot commented May 1, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0)

Grey Divider


Remediation recommended

1. Unfiltered check_suite runs 🐞 Bug ☼ Reliability
Description
The automerge job now runs on every check_suite:completed event because the PR-presence guard was
removed, so it will execute even when the check suite isn't associated with a pull request. This can
cause unnecessary runs and can change merge timing/side-effects because the automerge action runs
with contents: write and pull-requests: write permissions even on non-PR check suites.
Code

.github/workflows/automerge.yml[L22-24]

-    if: >
-      github.event_name != 'check_suite' ||
-      github.event.check_suite.pull_requests[0] != null
Evidence
The workflow explicitly subscribes to check_suite: completed, and the removed if: was the only
logic preventing the job from running when check_suite.pull_requests[0] is null/absent. Since CI
runs on push, check suites can complete for non-PR commits as well, which will now also trigger
the automerge job and run the automerge action with write permissions.

.github/workflows/automerge.yml[2-24]
.github/workflows/automerge.yml[25-39]
.github/workflows/ci.yml[1-4]
.github/dependabot.yml[2-33]

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

### Issue description
The `automerge` job now runs on all `check_suite:completed` events, including those not tied to a PR, because the job-level `if:` guard was removed.

### Issue Context
This workflow runs an automerge action with `contents: write` and `pull-requests: write` permissions; running it on non-PR check suites increases execution frequency and can change side-effects/merge timing.

### Fix Focus Areas
- .github/workflows/automerge.yml[16-24]

### Suggested fix
Re-introduce a job-level `if:` filter (or remove the `check_suite` trigger entirely if it’s no longer needed). For example, restore the previous guard so `check_suite` events only run when `github.event.check_suite.pull_requests[0]` is present.

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


Grey Divider

Qodo Logo

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 1, 2026

Open in StackBlitz

npm i https://pkg.pr.new/tokenu@26

commit: 7193589

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.73%. Comparing base (d6ca6fd) to head (7193589).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #26   +/-   ##
=======================================
  Coverage   93.73%   93.73%           
=======================================
  Files           5        5           
  Lines         431      431           
  Branches       88       88           
=======================================
  Hits          404      404           
  Misses         22       22           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lirantal lirantal self-assigned this May 1, 2026
@lirantal lirantal merged commit 2f778ec into main May 1, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants