Skip to content

Commit bcd575c

Browse files
feat: create copilot-setup-steps.yml (#4794)
* feat: create `copilot-setup-steps.yml` As suggested within https://docs.github.com/en/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment#preinstalling-tools-or-dependencies-in-copilots-environment we'd like to ensure that Copilot starts with a correct environment and w/o the need to determine it's setup itself. * Update copilot-setup-steps.yml --------- Co-authored-by: Michael Kraus <michael.m.kraus@deutschebahn.com>
1 parent 3747595 commit bcd575c

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16+
copilot-setup-steps:
17+
runs-on: ubuntu-24.04 # Use Ubuntu 24.04 explicitly
18+
19+
# Set the permissions to the lowest permissions possible needed for your steps.
20+
# Copilot will be given its own token for its operations.
21+
permissions:
22+
# 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.
23+
contents: read
24+
25+
# You can define any steps you want, and they will run before the agent starts.
26+
# If you do not check out your code, Copilot will do this for you.
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v5
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version-file: ".nvmrc"
35+
cache: "npm"
36+
37+
- name: Install JavaScript dependencies
38+
run: npm ci
39+
40+
# TODO: we probably would want to enhance this with further aspects like e.g. linting or testing. But we would need to determine the tradeoff in between slowing down Copilot with this, as we would most likely run some of this work later on within the PR anyhow.

0 commit comments

Comments
 (0)