Update Copilot Setup Steps for use with a merge queue#43247
Update Copilot Setup Steps for use with a merge queue#43247jonstacks wants to merge 2 commits intogithub:mainfrom
Conversation
Co-authored-by: jonstacks <6900888+jonstacks@users.noreply.github.com>
How to review these changes 👓Thank you for your contribution. To review these changes, choose one of the following options: A Hubber will need to deploy your changes internally to review. Table of review linksNote: Please update the URL for your staging server or codespace. The table shows the files in the
Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server 🤖 This comment is automatically generated. |
There was a problem hiding this comment.
Pull request overview
Updates the Copilot Coding Agent documentation to address how copilot-setup-steps.yml workflow triggers behave when a repository uses a merge queue, aiming to reduce unnecessary workflow runs.
Changes:
- Adds a new note explaining that merge queues can cause additional
push-triggered workflow runs. - Suggests workflow trigger filters (e.g., ignoring
gh-readonly-queue/**) to avoid merge-queue-related runs and links to merge queue documentation.
| ``` | ||
|
|
||
| > [!NOTE] | ||
| > If your repository uses a merge queue, the `push` trigger above will also run when pull requests are added to the merge queue. To prevent this, add `branches-ignore: ['gh-readonly-queue/**']` to the `push` trigger and restrict the `pull_request` trigger to your default branch with `branches: [YOUR-DEFAULT-BRANCH]`. For more information, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue). |
There was a problem hiding this comment.
The mitigation here implies both branches-ignore (on push) and restricting pull_request to the default branch are needed to stop merge-queue-related runs. In practice, the extra runs come from the merge queue pushing to gh-readonly-queue/**, so branches-ignore on push addresses that; tightening pull_request doesn’t prevent the merge-queue push-triggered runs and could unintentionally stop validation for PRs targeting non-default branches. Consider rewording to make the pull_request.branches restriction optional/separate, and (if relevant) call out that workflows required for merge queue checks should use the merge_group event instead of relying on push to queue branches.
| > If your repository uses a merge queue, the `push` trigger above will also run when pull requests are added to the merge queue. To prevent this, add `branches-ignore: ['gh-readonly-queue/**']` to the `push` trigger and restrict the `pull_request` trigger to your default branch with `branches: [YOUR-DEFAULT-BRANCH]`. For more information, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue). | |
| > If your repository uses a merge queue, the `push` trigger above will also run when pull requests are added to the merge queue, because the merge queue pushes to `gh-readonly-queue/**` branches. To prevent these extra runs, add `branches-ignore: ['gh-readonly-queue/**']` to the `push` trigger. If you only want to validate pull requests that target your default branch, you can additionally restrict the `pull_request` trigger with `branches: [YOUR-DEFAULT-BRANCH]`, but this is optional and will stop validation for pull requests targeting other branches. For workflows that must participate in merge queue checks, consider using the `merge_group` event instead of relying on `push` to queue branches. For more information, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue). |
Why:
Closes: #43246
What's being changed (if available, include any code snippets, screenshots, or gifs):
When I told copilot the issue I was having, it went for updating with a note. If the GitHub team decides its better implemented some other way, that works too!
Check off the following: