Skip to content

Update Copilot Setup Steps for use with a merge queue#43247

Open
jonstacks wants to merge 2 commits intogithub:mainfrom
jonstacks:copilot/update-copilot-docs
Open

Update Copilot Setup Steps for use with a merge queue#43247
jonstacks wants to merge 2 commits intogithub:mainfrom
jonstacks:copilot/update-copilot-docs

Conversation

@jonstacks
Copy link

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!

image

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

Copilot AI and others added 2 commits March 6, 2026 02:37
Co-authored-by: jonstacks <6900888+jonstacks@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 6, 2026 03:32
@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

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 links

Note: Please update the URL for your staging server or codespace.

The table shows the files in the content directory that were changed in this pull request. This helps you review your changes on a staging server. Changes to the data directory are not included in this table.

Source Review Production What Changed
copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment.md fpt
ghec
fpt
ghec

Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server

🤖 This comment is automatically generated.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
> 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).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage Do not begin working on this issue until triaged by the team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a note for copilot-setup-steps.yml and using with a merge queue

3 participants