Skip to content

Commit 788b2bc

Browse files
Pin all versions of any uses: in the sast, test-claudecode.yaml and action.yaml files
Instead of using @Version, pin all github actions uses to a specific commit hash. This makes is that much harder for a supply chain attack to occur.
1 parent 25e460e commit 788b2bc

File tree

3 files changed

+50
-50
lines changed

3 files changed

+50
-50
lines changed

.github/workflows/sast.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ jobs:
1414
contents: read
1515
pull-requests: write
1616
steps:
17-
- uses: actions/checkout@v4
18-
19-
- uses: ./ # Points directly to action.yml
17+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 pinned to commit hash
18+
19+
- uses: ./ # Points directly to action.yml
2020
with:
2121
comment-pr: true
2222
upload-results: true
2323
exclude-directories: "tests/vulnerable"
2424
claude-api-key: ${{ secrets.CLAUDE_API_KEY }}
25-
run-every-commit: true
25+
run-every-commit: true

.github/workflows/test-claudecode.yml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,45 @@ permissions:
1616
jobs:
1717
test-claudecode:
1818
runs-on: ubuntu-latest
19-
19+
2020
steps:
21-
- uses: actions/checkout@v4
22-
23-
- name: Set up Python
24-
uses: actions/setup-python@v4
25-
with:
26-
python-version: '3.10'
27-
28-
- name: Set up Node.js
29-
uses: actions/setup-node@v4
30-
with:
31-
node-version: '20'
32-
33-
- name: Install Claude CLI
34-
run: |
35-
npm install -g @anthropic-ai/claude-code
36-
37-
- name: Install dependencies
38-
run: |
39-
pip install pytest pytest-cov
40-
pip install -r claudecode/requirements.txt
41-
42-
- name: Run ClaudeCode unit tests
43-
run: |
44-
export PYTHONPATH="${PYTHONPATH}:${PWD}"
45-
pytest claudecode -v --cov=claudecode --cov-report=term-missing
46-
47-
- name: Install Bun
48-
uses: oven-sh/setup-bun@v2
49-
with:
50-
bun-version: latest
51-
52-
- name: Install script dependencies
53-
run: |
54-
cd scripts
55-
bun install
56-
57-
- name: Run comment script tests
58-
run: |
59-
cd scripts
60-
bun test
21+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 pinned to commit hash
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4.9.1 pinned to commit hash
25+
with:
26+
python-version: "3.10"
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 pinned to commit hash
30+
with:
31+
node-version: "20"
32+
33+
- name: Install Claude CLI
34+
run: |
35+
npm install -g @anthropic-ai/claude-code
36+
37+
- name: Install dependencies
38+
run: |
39+
pip install pytest pytest-cov
40+
pip install -r claudecode/requirements.txt
41+
42+
- name: Run ClaudeCode unit tests
43+
run: |
44+
export PYTHONPATH="${PYTHONPATH}:${PWD}"
45+
pytest claudecode -v --cov=claudecode --cov-report=term-missing
46+
47+
- name: Install Bun
48+
uses: oven-sh/setup-bun@b7a1c7ccf290d58743029c4f6903da283811b979 # v2.1.0 pinned to commit hash
49+
with:
50+
bun-version: latest
51+
52+
- name: Install script dependencies
53+
run: |
54+
cd scripts
55+
bun install
56+
57+
- name: Run comment script tests
58+
run: |
59+
cd scripts
60+
bun test

action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ runs:
6969
echo "::endgroup::"
7070
7171
- name: Set up Python
72-
uses: actions/setup-python@v5
72+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 pinned to commit hash
7373
with:
7474
python-version: '3.x'
7575

7676
- name: Check ClaudeCode run history
7777
id: claudecode-history
7878
if: github.event_name == 'pull_request'
79-
uses: actions/cache@v4
79+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 pinned to commit hash
8080
with:
8181
path: .claudecode-marker
8282
key: claudecode-${{ github.repository_id }}-pr-${{ github.event.pull_request.number }}-${{ github.sha }}
@@ -149,14 +149,14 @@ runs:
149149
150150
- name: Save ClaudeCode reservation to cache
151151
if: steps.claudecode-check.outputs.enable_claudecode == 'true' && github.event_name == 'pull_request'
152-
uses: actions/cache/save@v4
152+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 pinned to commit hash
153153
with:
154154
path: .claudecode-marker
155155
key: claudecode-${{ github.repository_id }}-pr-${{ github.event.pull_request.number }}-${{ github.sha }}
156156

157157
- name: Set up Node.js
158158
if: steps.claudecode-check.outputs.enable_claudecode == 'true'
159-
uses: actions/setup-node@v4
159+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 pinned to commit hash
160160
with:
161161
node-version: '18'
162162

@@ -307,7 +307,7 @@ runs:
307307

308308
- name: Upload scan results
309309
if: always() && inputs.upload-results == 'true'
310-
uses: actions/upload-artifact@v4
310+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 pinned to commit hash
311311
with:
312312
name: security-review-results
313313
path: |

0 commit comments

Comments
 (0)