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

Aperta Adatta ai principianti
#43,246 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
84/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github-actions

Direzione di ricerca

Inizia dall’articolo collegato sui passaggi di configurazione di Copilot e individua l’esempio esistente copilot-setup-steps.yml. Esamina il comportamento dei relativi trigger push e pull_request con i branch di merge queue, quindi aggiorna l’esempio oppure aggiungi una nota inline usando la configurazione proposta. Il lavoro è completato quando la documentazione avverte delle esecuzioni non necessarie di merge queue, preservando al contempo i test manuali e la convalida delle modifiche.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

content github_actions never-stale Waiting on contributor
Code of Conduct
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:

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 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:

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

Lingua principale
TypeScript
Stelle
20.9k
Fork
68.8k
Merge medio
15h 4m
PR unite (30g)
103

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/docs

Tutte le issue di github/docs

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.