Skip to content

Commit 358801c

Browse files
Copilotnjzjz
andcommitted
feat: revise copilot-setup-steps.yml following GitHub example with proper triggers and permissions
Co-authored-by: njzjz <[email protected]>
1 parent 363dea8 commit 358801c

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,43 @@
1-
---
2-
name: Copilot Setup Steps
1+
name: "Copilot Setup Steps"
32

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
45
on:
5-
workflow_dispatch: {}
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
613

714
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
816
copilot-setup-steps:
917
runs-on: ubuntu-latest
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.
1027
steps:
11-
- name: Checkout repository
12-
uses: actions/checkout@v5
28+
- name: Checkout code
29+
uses: actions/checkout@v4
1330

1431
- name: Set up Python
1532
uses: actions/setup-python@v5
1633
with:
1734
python-version: "3.11"
1835

19-
- name: Set up uv
20-
uses: astral-sh/setup-uv@v6
21-
with:
22-
enable-cache: true
23-
cache-dependency-glob: |
24-
**/requirements*.txt
25-
**/pyproject.toml
36+
- name: Install uv
37+
run: |
38+
# Install uv using pip to avoid network restrictions
39+
python -m pip install --upgrade pip
40+
python -m pip install uv
2641
2742
- name: Create virtual environment and install dependencies
2843
run: |

0 commit comments

Comments
 (0)