github / github/docs

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

Abierto
#42,379 9 comentarios 2 reacciones 0 asignados Ver en GitHub
content copilot never-stale
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#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

```yml
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_

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.