diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index bfa000e..603224c 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -3,6 +3,9 @@ name: Request Auto-Merge on: pull_request_target: types: [opened, synchronize, reopened, ready_for_review] + # Repositories with a merge queue require this workflow on the queue's merge groups too. There is + # nothing to request there, so the job is skipped and the workflow reports success. + merge_group: permissions: contents: read @@ -11,6 +14,7 @@ permissions: jobs: request-auto-merge: if: >- + github.event_name == 'pull_request_target' && !github.event.pull_request.draft && github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest diff --git a/README.md b/README.md index 11eb3c5..6ac5342 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ events that invoke the organization workflow. The organization ruleset applies this workflow to Chio Labs public repositories. +The workflow also runs on merge queue groups, because the ruleset requires it there; its job is +skipped and it reports success, leaving the queue's own required checks to decide. + Draft and fork-based pull requests are intentionally excluded. A draft is handled when it becomes ready for review. Product workflows remain responsible for release-specific validation, while this organization workflow is the single owner of requesting auto-merge.