Skip to content

ci: verify all PR checks before triggering auto-merge - #6556

Open
rafaelespinoza wants to merge 4 commits into
avelino:mainfrom
rafaelespinoza:ci-fix_auto_merge
Open

ci: verify all PR checks before triggering auto-merge#6556
rafaelespinoza wants to merge 4 commits into
avelino:mainfrom
rafaelespinoza:ci-fix_auto_merge

Conversation

@rafaelespinoza

Copy link
Copy Markdown
Contributor

Fixes #6550.

The auto-merge job in pr-quality-check.yaml relies on native
needs gates, which only evaluate jobs inside the same workflow file.
Consequently, failures in external workflows (such as tests.yaml)
were not visible to this job, allowing PRs to auto-merge despite failing
tests.

This change adds a pre-check step using gh pr checks that:

  1. Verifies that the evaluated HEAD commit matches the current commit.
    Intended to address race conditions that may occur due to new pushes.
  2. Filters out the active workflow run using github.run_id.
  3. Verifies all external PR checks are in a passing state (SUCCESS,
    SKIPPED, or NEUTRAL).

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Automated Quality Checks

Skipped — this PR does not modify README.md, so package quality checks do not apply.

This is expected for maintenance, documentation, or workflow PRs.

@rafaelespinoza
rafaelespinoza marked this pull request as ready for review August 5, 2026 04:09
@rafaelespinoza

Copy link
Copy Markdown
Contributor Author

@avelino, could you please have a look at this one when you have some time? Thanks

@rafaelespinoza

Copy link
Copy Markdown
Contributor Author

Automated Quality Checks

Skipped — this PR does not modify README.md, so package quality checks do not apply.

This is expected for maintenance, documentation, or workflow PRs.

Fixes avelino#6550.

The `auto-merge` job in `pr-quality-check.yaml` relies on native
`needs` gates, which only evaluate jobs inside the same workflow file.
Consequently, failures in external workflows (such as `tests.yaml`)
were not visible to this job, allowing PRs to auto-merge despite failing
tests.

This change adds a pre-check step using `gh pr checks` that:

1. Verifies that the evaluated HEAD commit matches the current commit.
   Intended to address race conditions that may occur due to new pushes.
2. Filters out the active workflow run using `github.run_id`.
3. Verifies all external PR checks are in a passing state (SUCCESS,
   SKIPPED, or NEUTRAL).
Recase variables, outside values are UPCASED, while local to script
variables are downcased.
Add some extra print statements, I found them helpful for debugging.
Print JSON for non passing checks, seems easier to read. Open to feedback.
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.

CI failures in TestDuplicatedLinks, TestAlpha

1 participant