is it redudant to run Copilot Setup Steps on `push` and `pull_request`?
- 主要言語
- TypeScript
- スター
- 20.8k
- フォーク
- 68.7k
- 平均マージ
- 12時間 24分
- マージ済み PR(30日)
- 105
説明
### 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.
```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_
コントリビューションガイド
評価
この issue はまだ評価されていません。