Skip to content

Commit 1c77617

Browse files
authored
Merge pull request #2 from CopilotKit/fix/ci-hardening
Harden CI: SHA-pin all actions, add persist-credentials: false
2 parents 6541a67 + ee8d037 commit 1c77617

15 files changed

Lines changed: 118 additions & 39 deletions

.github/workflows/check_license.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,21 @@ on:
2020
- main
2121
pull_request:
2222

23+
permissions:
24+
contents: read
25+
2326
jobs:
2427
check-license:
2528
runs-on: ubuntu-latest
2629

2730
steps:
2831
- name: Checkout code
29-
uses: actions/checkout@v6
32+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
33+
with:
34+
persist-credentials: false
3035

3136
- name: Set up Go
32-
uses: actions/setup-go@v6
37+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
3338
with:
3439
go-version: '1.21'
3540

.github/workflows/check_private_index.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,17 @@ on:
1818
push:
1919
pull_request:
2020

21+
permissions:
22+
contents: read
23+
2124
jobs:
2225
check-for-private-index:
2326
runs-on: ubuntu-latest
2427
steps:
2528
- name: Checkout code
26-
uses: actions/checkout@v6
29+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
30+
with:
31+
persist-credentials: false
2732
- name: Search for private index URL in uv.lock files
2833
run: |
2934
FORBIDDEN_URL="us-python.pkg.dev"

.github/workflows/composer_build_and_test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,25 @@ on:
2424
- 'tools/composer/**'
2525
- '.github/workflows/composer_build_and_test.yml'
2626

27+
permissions:
28+
contents: read
29+
2730
jobs:
2831
build-and-test:
2932
runs-on: ubuntu-latest
3033

3134
steps:
32-
- uses: actions/checkout@v6
35+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
36+
with:
37+
persist-credentials: false
3338

3439
- name: Install pnpm
35-
uses: pnpm/action-setup@v4
40+
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
3641
with:
3742
version: 10
3843

3944
- name: Set up Node.js
40-
uses: actions/setup-node@v6
45+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
4146
with:
4247
node-version: '20'
4348
cache: 'pnpm'

.github/workflows/docs.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ on:
3232
- "mkdocs.yml"
3333
- "docs/**"
3434

35+
permissions:
36+
contents: read
37+
3538
jobs:
3639
build_and_deploy:
3740
runs-on: ubuntu-latest
@@ -43,7 +46,7 @@ jobs:
4346

4447
steps:
4548
- name: Checkout Code
46-
uses: actions/checkout@v6
49+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
4750
with:
4851
token: ${{ secrets.GITHUB_TOKEN }}
4952
fetch-depth: 0
@@ -54,12 +57,12 @@ jobs:
5457
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
5558
5659
- name: Setup Python
57-
uses: actions/setup-python@v6
60+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
5861
with:
5962
python-version: 3.13
6063

6164
- name: Restore pip cache
62-
uses: actions/cache@v5
65+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
6366
with:
6467
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }}
6568
path: ~/.cache/pip

.github/workflows/editor_build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,20 @@ on:
2828
- 'renderers/web_core/**'
2929
- '.github/workflows/editor_build.yml'
3030

31+
permissions:
32+
contents: read
33+
3134
jobs:
3235
build:
3336
runs-on: ubuntu-latest
3437

3538
steps:
36-
- uses: actions/checkout@v6
39+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
40+
with:
41+
persist-credentials: false
3742

3843
- name: Set up Node.js
39-
uses: actions/setup-node@v6
44+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
4045
with:
4146
node-version: '20'
4247

.github/workflows/inspector_build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,20 @@ on:
2929
- 'renderers/web_core/**'
3030
- '.github/workflows/inspector_build.yml'
3131

32+
permissions:
33+
contents: read
34+
3235
jobs:
3336
build:
3437
runs-on: ubuntu-latest
3538

3639
steps:
37-
- uses: actions/checkout@v6
40+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
41+
with:
42+
persist-credentials: false
3843

3944
- name: Set up Node.js
40-
uses: actions/setup-node@v6
45+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
4146
with:
4247
node-version: '20'
4348

.github/workflows/java_build_and_test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,22 @@ on:
2626
- 'agent_sdks/java/**'
2727
- 'specification/**/json/**'
2828

29+
permissions:
30+
contents: read
31+
2932
jobs:
3033
build-and-test:
3134
name: Build and test Java agent sample
3235
runs-on: ubuntu-latest
3336

3437
steps:
3538
- name: Checkout repository
36-
uses: actions/checkout@v6
39+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
40+
with:
41+
persist-credentials: false
3742

3843
- name: Set up JDK
39-
uses: actions/setup-java@v5
44+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
4045
with:
4146
java-version: '21'
4247
distribution: 'temurin'

.github/workflows/lit_build_and_test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,20 @@ on:
2727
- 'renderers/web_core/**'
2828
- '.github/workflows/lit_build_and_test.yml'
2929

30+
permissions:
31+
contents: read
32+
3033
jobs:
3134
build-and-test:
3235
runs-on: ubuntu-latest
3336

3437
steps:
35-
- uses: actions/checkout@v6
38+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
39+
with:
40+
persist-credentials: false
3641

3742
- name: Set up Node.js
38-
uses: actions/setup-node@v6
43+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
3944
with:
4045
node-version: '20'
4146

.github/workflows/lit_samples_build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,20 @@ on:
2323
paths-ignore:
2424
- 'samples/agent/adk/**'
2525

26+
permissions:
27+
contents: read
28+
2629
jobs:
2730
build:
2831
runs-on: ubuntu-latest
2932

3033
steps:
31-
- uses: actions/checkout@v6
34+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
35+
with:
36+
persist-credentials: false
3237

3338
- name: Set up Node.js
34-
uses: actions/setup-node@v6
39+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
3540
with:
3641
node-version: '20'
3742

.github/workflows/ng_build_and_test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,20 @@ on:
2323
paths-ignore:
2424
- 'samples/agent/adk/**'
2525

26+
permissions:
27+
contents: read
28+
2629
jobs:
2730
build-and-test:
2831
runs-on: ubuntu-latest
2932

3033
steps:
31-
- uses: actions/checkout@v6
34+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
35+
with:
36+
persist-credentials: false
3237

3338
- name: Set up Node.js
34-
uses: actions/setup-node@v6
39+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
3540
with:
3641
node-version: '20'
3742

0 commit comments

Comments
 (0)