Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

已关闭 适合新手
#42,379 9 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
75/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
github-actions
领域
documentation

调研方向

从受影响的 Copilot 文档文章及其 copilot-setup-steps.yml 示例开始。检查文档中记录的 push 和 pull_request 触发器,以及 issue 中对 Check Run 的观察结果;当示例和周围的指导清楚地反映预期的触发器配置,并且文档检查通过时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
TypeScript
星标
20.9k
派生
68.8k
平均合并
12 小时 41 分钟
30 天内合并 PR
120

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/docs 的其他 Issue

查看 github/docs 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。