Skip to content

Commit cdee13b

Browse files
committed
ci: harden CI supply chain
Pin all GitHub Actions to commit SHAs to prevent tag-based supply chain attacks (same class as CVE-2025-30066). Replace softprops/action-gh-release (single-maintainer, no security policy) with gh CLI. Add top-level permissions: {} to all workflows that lacked it, enforcing least-privilege by default. Enable Dependabot for GitHub Actions and pip dependencies. Closes #471
1 parent c27ad62 commit cdee13b

File tree

10 files changed

+67
-42
lines changed

10 files changed

+67
-42
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
commit-message:
8+
prefix: "ci"
9+
- package-ecosystem: pip
10+
directory: /
11+
schedule:
12+
interval: weekly
13+
commit-message:
14+
prefix: "chore"

.github/workflows/agentic-ci-pr-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
echo "sha=$SHA" >> "$GITHUB_OUTPUT"
124124
125125
- name: Checkout PR branch
126-
uses: actions/checkout@v4
126+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
127127
with:
128128
ref: ${{ steps.head.outputs.sha }}
129129
fetch-depth: 0

.github/workflows/build-docs.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ on:
1010
types:
1111
- published
1212

13+
permissions: {}
14+
1315
jobs:
1416
build-notebooks:
1517
uses: ./.github/workflows/build-notebooks.yml
@@ -23,17 +25,17 @@ jobs:
2325
contents: write
2426
steps:
2527
- name: Checkout repository
26-
uses: actions/checkout@v6
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2729
- name: Install uv
28-
uses: astral-sh/setup-uv@v7
30+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
2931
with:
3032
version: "0.9.5"
3133
- name: Set up Python
3234
run: uv python install 3.11
3335
- name: Install dependencies for docs
3436
run: uv sync --all-packages --group docs
3537
- name: Download artifact from previous step
36-
uses: actions/download-artifact@v7
38+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
3739
with:
3840
name: notebooks
3941
path: docs/notebooks

.github/workflows/build-notebooks.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
1414
schedule:
1515
- cron: "0 12 * * MON"
1616

17+
permissions: {}
18+
1719
jobs:
1820
build:
1921
runs-on: ubuntu-latest
@@ -25,17 +27,17 @@ jobs:
2527
OPENROUTER_API_KEY: ${{ secrets.TEST_OPENROUTER_API_KEY }}
2628
steps:
2729
- name: Checkout repository
28-
uses: actions/checkout@v6
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2931
- name: Install uv
30-
uses: astral-sh/setup-uv@v7
32+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
3133
with:
3234
version: "0.9.5"
3335
- name: Set up Python
3436
run: uv python install 3.11
3537
- name: Restore notebook cache
3638
if: inputs.use_cache
3739
id: cache
38-
uses: actions/cache@v5
40+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
3941
with:
4042
path: .notebook-cache
4143
key: notebooks-${{ hashFiles('docs/notebook_source/*.py') }}
@@ -80,7 +82,7 @@ jobs:
8082
- name: Convert and execute notebooks
8183
run: make convert-execute-notebooks ${{ inputs.use_cache && 'USE_CACHE=1' || '' }}
8284
- name: Upload notebooks as artifacts
83-
uses: actions/upload-artifact@v6
85+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
8486
with:
8587
name: notebooks
8688
path: docs/notebooks

.github/workflows/check-colab-notebooks.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@ on:
1111
- 'docs/notebook_source/*.py'
1212
workflow_dispatch:
1313

14+
permissions: {}
15+
1416
jobs:
1517
check-colab-notebooks:
1618
name: Check Colab Notebooks
1719
runs-on: ubuntu-latest
1820

1921
steps:
2022
- name: Checkout code
21-
uses: actions/checkout@v6
23+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2224

2325
- name: Install uv
24-
uses: astral-sh/setup-uv@v7
26+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
2527
with:
2628
version: "latest"
2729
python-version: "3.11"

.github/workflows/ci.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
branches: [ main ]
88
workflow_dispatch:
99

10+
permissions: {}
11+
1012
jobs:
1113
# ===========================================================================
1214
# Independent Package Tests
@@ -24,10 +26,10 @@ jobs:
2426

2527
steps:
2628
- name: Checkout code
27-
uses: actions/checkout@v6
29+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2830

2931
- name: Install uv
30-
uses: astral-sh/setup-uv@v7
32+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
3133
with:
3234
version: "latest"
3335
python-version: ${{ matrix.python-version }}
@@ -55,10 +57,10 @@ jobs:
5557

5658
steps:
5759
- name: Checkout code
58-
uses: actions/checkout@v6
60+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
5961

6062
- name: Install uv
61-
uses: astral-sh/setup-uv@v7
63+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
6264
with:
6365
version: "latest"
6466
python-version: ${{ matrix.python-version }}
@@ -86,10 +88,10 @@ jobs:
8688

8789
steps:
8890
- name: Checkout code
89-
uses: actions/checkout@v6
91+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
9092

9193
- name: Install uv
92-
uses: astral-sh/setup-uv@v7
94+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
9395
with:
9496
version: "latest"
9597
python-version: ${{ matrix.python-version }}
@@ -125,10 +127,10 @@ jobs:
125127

126128
steps:
127129
- name: Checkout code
128-
uses: actions/checkout@v6
130+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
129131

130132
- name: Install uv
131-
uses: astral-sh/setup-uv@v7
133+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
132134
with:
133135
version: "latest"
134136
python-version: ${{ matrix.python-version }}
@@ -163,10 +165,10 @@ jobs:
163165

164166
steps:
165167
- name: Checkout code
166-
uses: actions/checkout@v6
168+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
167169

168170
- name: Install uv
169-
uses: astral-sh/setup-uv@v7
171+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
170172
with:
171173
version: "latest"
172174
python-version: ${{ matrix.python-version }}
@@ -185,10 +187,10 @@ jobs:
185187

186188
steps:
187189
- name: Checkout code
188-
uses: actions/checkout@v6
190+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
189191

190192
- name: Install uv
191-
uses: astral-sh/setup-uv@v7
193+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
192194
with:
193195
version: "latest"
194196
python-version: "3.11"
@@ -209,12 +211,12 @@ jobs:
209211

210212
steps:
211213
- name: Checkout code
212-
uses: actions/checkout@v6
214+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
213215
with:
214216
fetch-depth: 0 # Full history needed for file creation dates
215217

216218
- name: Install uv
217-
uses: astral-sh/setup-uv@v7
219+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
218220
with:
219221
version: "latest"
220222
python-version: "3.11"

.github/workflows/docs-preview.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
- "packages/*/src/data_designer/**"
1010
- ".github/workflows/docs-preview.yml"
1111

12+
permissions: {}
13+
1214
jobs:
1315
build-and-deploy:
1416
runs-on: ubuntu-latest
@@ -17,10 +19,10 @@ jobs:
1719
pull-requests: write
1820
steps:
1921
- name: Checkout repository
20-
uses: actions/checkout@v6
22+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2123

2224
- name: Install uv
23-
uses: astral-sh/setup-uv@v7
25+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
2426
with:
2527
version: "0.9.5"
2628

@@ -78,22 +80,22 @@ jobs:
7880

7981
- name: Deploy to Cloudflare Pages
8082
id: deploy
81-
uses: cloudflare/wrangler-action@v3
83+
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3
8284
with:
8385
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
8486
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
8587
command: pages deploy site/ --project-name=dd-docs-preview --branch=pr-${{ github.event.pull_request.number }}
8688

8789
- name: Find existing comment
88-
uses: peter-evans/find-comment@v4
90+
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4
8991
id: find-comment
9092
with:
9193
issue-number: ${{ github.event.pull_request.number }}
9294
comment-author: "github-actions[bot]"
9395
body-includes: "<!-- docs-preview -->"
9496

9597
- name: Post or update PR comment
96-
uses: peter-evans/create-or-update-comment@v5
98+
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5
9799
with:
98100
comment-id: ${{ steps.find-comment.outputs.comment-id }}
99101
issue-number: ${{ github.event.pull_request.number }}

.github/workflows/health-checks.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ on:
88
types: [published]
99
workflow_dispatch:
1010

11+
permissions: {}
12+
1113
jobs:
1214
health-checks:
1315
name: Provider Health Checks
1416
runs-on: ubuntu-latest
1517

1618
steps:
1719
- name: Checkout code
18-
uses: actions/checkout@v6
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1921

2022
- name: Install uv
21-
uses: astral-sh/setup-uv@v7
23+
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
2224
with:
2325
version: "latest"
2426
python-version: "3.11"

.github/workflows/pack-tutorials.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
release:
66
types: [published]
77

8+
permissions: {}
9+
810
jobs:
911
build-notebooks:
1012
uses: ./.github/workflows/build-notebooks.yml
@@ -17,7 +19,7 @@ jobs:
1719

1820
steps:
1921
- name: Download artifact from previous step
20-
uses: actions/download-artifact@v7
22+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
2123
with:
2224
name: notebooks
2325
path: data_designer_tutorial
@@ -27,7 +29,7 @@ jobs:
2729
run: |
2830
echo "SOURCE_FOLDER_PATH=data_designer_tutorial" >> $GITHUB_ENV
2931
echo "ZIP_FILE_NAME=data_designer_tutorial.zip" >> $GITHUB_ENV
30-
32+
3133
- name: Check if source folder exists
3234
run: |
3335
if [ ! -d "${{ env.SOURCE_FOLDER_PATH }}" ]; then
@@ -58,20 +60,17 @@ jobs:
5860
exit 1
5961
fi
6062
fi
61-
63+
6264
echo "Latest release tag found: $LATEST_TAG"
6365
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
6466
env:
6567
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6668

6769
- name: Upload zip file as release asset
68-
uses: softprops/action-gh-release@v2
69-
with:
70-
tag_name: ${{ steps.get_release.outputs.tag }}
71-
files: ${{ env.ZIP_FILE_NAME }}
72-
draft: false
73-
prerelease: false
74-
70+
env:
71+
GH_TOKEN: ${{ github.token }}
72+
run: gh release upload "${{ steps.get_release.outputs.tag }}" "${{ env.ZIP_FILE_NAME }}"
73+
7574
- name: Cleanup
7675
if: always()
7776
run: rm -f ${{ env.ZIP_FILE_NAME }}

.github/workflows/semantic-pull-requests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ permissions:
2323

2424
jobs:
2525
semantic-pull-request:
26-
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_semantic_pull_request.yml@v0.65.12
26+
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_semantic_pull_request.yml@21f18ae8b669fd0de1a25ff0e82a1660ec1aa517 # v0.65.12

0 commit comments

Comments
 (0)