Skip to content

Commit b0a908a

Browse files
dreamiurgclaude
andauthored
ci: pin GitHub Actions to commit SHAs for security (#56)
Pin all GitHub Actions dependencies to specific commit SHAs instead of version tags to prevent supply chain attacks. This follows OpenSSF Scorecard best practices for dependency pinning. Pinned actions: - actions/checkout@v5 - actions/create-github-app-token@v2 - actions/setup-python@v6 - actions/upload-artifact@v4 - amannn/action-semantic-pull-request@v6 - astral-sh/setup-uv@v7 - codecov/codecov-action@v5 - github/codeql-action/*@V3 - github/codeql-action/*@v4 - ossf/scorecard-action@v2.4.3 - pypa/gh-action-pypi-publish@release/v1 All SHAs include comments showing the original version tag for maintainability. Expected impact: Pinned-Dependencies score 0 → 10 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent a13ecdf commit b0a908a

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ jobs:
3030
name: Lint and format check
3131
runs-on: ubuntu-latest
3232
steps:
33-
- uses: actions/checkout@v5
33+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
3434

3535
- name: Set up Python
36-
uses: actions/setup-python@v6
36+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
3737
with:
3838
python-version: "3.14"
3939
cache: pip
4040
cache-dependency-path: pyproject.toml
4141

4242
- name: Install uv
43-
uses: astral-sh/setup-uv@v7
43+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7
4444
with:
4545
enable-cache: true
4646
cache-dependency-glob: "pyproject.toml"
@@ -75,17 +75,17 @@ jobs:
7575
python-version: "3.14"
7676

7777
steps:
78-
- uses: actions/checkout@v5
78+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
7979

8080
- name: Set up Python ${{ matrix.python-version }}
81-
uses: actions/setup-python@v6
81+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
8282
with:
8383
python-version: ${{ matrix.python-version }}
8484
cache: pip
8585
cache-dependency-path: pyproject.toml
8686

8787
- name: Install uv
88-
uses: astral-sh/setup-uv@v7
88+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7
8989
with:
9090
enable-cache: true
9191
cache-dependency-glob: "pyproject.toml"
@@ -98,7 +98,7 @@ jobs:
9898

9999
- name: Upload coverage to Codecov
100100
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.14'
101-
uses: codecov/codecov-action@v5
101+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5
102102
with:
103103
token: ${{ secrets.CODECOV_TOKEN }}
104104
file: ./coverage.xml
@@ -110,7 +110,7 @@ jobs:
110110
if: github.event_name == 'pull_request'
111111
steps:
112112
- name: Validate PR title follows conventional commit format
113-
uses: amannn/action-semantic-pull-request@v6
113+
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6
114114
env:
115115
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116116
with:

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ jobs:
2424

2525
steps:
2626
- name: Checkout repository
27-
uses: actions/checkout@v5
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2828

2929
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v3
30+
uses: github/codeql-action/init@5d5cd550d3e189c569da8f16ea8de2d821c9bf7a # v3
3131
with:
3232
languages: python
3333
# Queries: security-extended includes all security checks
3434
queries: security-extended
3535

3636
- name: Perform CodeQL Analysis
37-
uses: github/codeql-action/analyze@v3
37+
uses: github/codeql-action/analyze@5d5cd550d3e189c569da8f16ea8de2d821c9bf7a # v3
3838
with:
3939
category: "/language:python"

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ jobs:
2020
steps:
2121
- name: Generate GitHub App token
2222
id: app-token
23-
uses: actions/create-github-app-token@v2
23+
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2
2424
with:
2525
app-id: ${{ secrets.RELEASE_APP_ID }}
2626
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
2727

2828
- name: Checkout
29-
uses: actions/checkout@v5
29+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
3030
with:
3131
fetch-depth: 0
3232
token: ${{ steps.app-token.outputs.token }}
3333

3434
- name: Set up Python
35-
uses: actions/setup-python@v6
35+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6
3636
with:
3737
python-version: '3.12'
3838
cache: pip
3939
cache-dependency-path: pyproject.toml
4040

4141
- name: Install uv
42-
uses: astral-sh/setup-uv@v7
42+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7
4343
with:
4444
enable-cache: true
4545
cache-dependency-glob: "pyproject.toml"
@@ -68,6 +68,6 @@ jobs:
6868
6969
- name: Publish to PyPI
7070
if: steps.semantic-release.outputs.new_release == 'true'
71-
uses: pypa/gh-action-pypi-publish@release/v1
71+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
7272
with:
7373
print-hash: true

.github/workflows/scorecard.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@ jobs:
2727

2828
steps:
2929
- name: Checkout code
30-
uses: actions/checkout@v5
30+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
3131
with:
3232
persist-credentials: false
3333

3434
- name: Run analysis
35-
uses: ossf/scorecard-action@v2.4.3
35+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
3636
with:
3737
results_file: results.sarif
3838
results_format: sarif
3939
# Publish results to OpenSSF REST API for the badge
4040
publish_results: true
4141

4242
- name: Upload artifact
43-
uses: actions/upload-artifact@v4
43+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
4444
with:
4545
name: SARIF file
4646
path: results.sarif
4747
retention-days: 5
4848

4949
- name: Upload to code-scanning
50-
uses: github/codeql-action/upload-sarif@v4
50+
uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee # v4
5151
with:
5252
sarif_file: results.sarif

0 commit comments

Comments
 (0)