github / github/docs

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

Abierto
#43,246 7 comentarios 0 reacciones 0 asignados Ver en GitHub
content github_actions never-stale Waiting on contributor
Lenguaje dominante
TypeScript
Estrellas
20.8k
Forks
68.7k
Merge medio
12 h 24 min
PR fusionados (30 d)
105

Descripción

### Code of Conduct

- [x] I have read and agree to the GitHub Docs project's [Code of Conduct](https://github.com/github/docs/blob/main/.github/CODE_OF_CONDUCT.md)

### What article on docs.github.com is affected?

https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment#customizing-copilots-development-environment-with-copilot-setup-steps

### What part(s) of the article would you like to see updated?

Somewhat related to #42379

In the github docs, it says that you can add the following to you copilot-setup-steps.yml file:

```yaml
name: "Copilot Setup Steps"

## Background
# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
```

While this works, I've found that if you use a merge queue then using the above configuration results in your workflow running every time a PR is added to the merge queue. We are use the larger, custom image GitHub hosted runners and this results in unnecessary runs & costs.

[github/copilot-sdk](https://github.com/github/copilot-sdk/actions/workflows/copilot-setup-steps.yml?query=event%3Apush) was the first public GitHub repo I found that had the same issue(although this one is just using default ubuntu-latest runners). It helped me figure out that behavior wasn't unique to our setup

## Proposed Content Update

I'd like to update the docs to either add an inline comment with commented out code or add a little inline note about if using a merge queue. This is what ended up working for us:

```yaml
name: "Copilot Setup Steps"

# Automatically run when changed so setup issues surface immediately.
# Also allows manual testing via the "Actions" tab.
on:
workflow_dispatch:
push:
branches-ignore:
- 'gh-readonly-queue/**'
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
branches:
- main
paths:
- .github/workflows/copilot-setup-steps.yml
```

### Additional information

_No response_

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.