is it redudant to run Copilot Setup Steps on `push` and `pull_request`?

Chiusa Adatta ai principianti
#42,379 9 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Inizia dall’articolo della documentazione di Copilot interessato e dal relativo esempio copilot-setup-steps.yml. Esamina i trigger push e pull_request documentati e l’osservazione del Check Run dell’issue; il lavoro è completo quando l’esempio e le indicazioni circostanti riflettono chiaramente la configurazione dei trigger prevista e i controlli della documentazione hanno esito positivo.

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

Descrizione

content copilot never-stale
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#preinstalling-tools-or-dependencies-in-copilots-environment

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

I don't think it should be suggested to have both push and pull_request as workflow triggers in the sample copilot-setup-steps.yml.

[!note]
If you run on push the commit in the pull_request will already have a Check Run associated with it from the push workflow trigger, so pull_request workflow trigger seems redundant in the sample workflow below.

ex.
Image

name: "Copilot Setup Steps"

# 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

jobs:
  # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
  copilot-setup-steps:
    runs-on: ubuntu-latest

    # Set the permissions to the lowest permissions possible needed for your steps.
    # Copilot will be given its own token for its operations.
    permissions:
      # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
      contents: read

    # You can define any steps you want, and they will run before the agent starts.
    # If you do not check out your code, Copilot will do this for you.
    steps:
      - name: Checkout code
        uses: actions/checkout@v5

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"
          cache: "npm"

      - name: Install JavaScript dependencies
        run: npm ci
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.