Skip to content

Commit ab4dceb

Browse files
dsarnoclaude
andauthored
ci: pin actions to SHAs, scope ci.yml token, add Dependabot, ignore reports (#548)
Supply-chain / repo-hygiene hardening from the pre-release review. - Pin every GitHub Action to a full commit SHA with a trailing version comment (incl. the high-value softprops/action-gh-release and pypa/gh-action-pypi-publish, which run with contents:write / id-token:write). A hijacked tag/branch can no longer alter what runs. (#540) - Add a top-level `permissions: contents: read` to ci.yml — its jobs only read the repo, but ran with the default token grant while executing third-party actions. release.yml / bump-and-release.yml / close-issues already declare scoped permissions. (#539) - Add .github/dependabot.yml (github-actions + pip, weekly) so the new SHA pins and Python deps get update PRs instead of silently aging. (#541) - .gitignore the generated audit/review HTML reports and the self-update smoke artifact so a stray `git add -A` can't commit them. (#543) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 9a92737 commit ab4dceb

6 files changed

Lines changed: 52 additions & 22 deletions

File tree

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
# Keep the SHA-pinned GitHub Actions fresh — Dependabot bumps the pin and
4+
# updates the trailing version comment, so pinning doesn't mean going stale.
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"
9+
commit-message:
10+
prefix: "ci(deps)"
11+
12+
# Python runtime + dev dependencies (pyproject.toml).
13+
- package-ecosystem: "pip"
14+
directory: "/"
15+
schedule:
16+
interval: "weekly"
17+
commit-message:
18+
prefix: "deps"

.github/workflows/bump-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
bump:
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@v6
35+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
3636

3737
- name: Read current version
3838
id: current

.github/workflows/ci.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
env:
1717
GODOT_AI_DISABLE_TELEMETRY: "true"
1818

19+
## CI only reads the repo — no job here writes to it, so drop the default
20+
## token down to read-only (third-party actions run with this grant too).
21+
permissions:
22+
contents: read
23+
1924
jobs:
2025
python-tests:
2126
name: Python ${{ matrix.python-version }} / ${{ matrix.os }}
@@ -31,10 +36,10 @@ jobs:
3136
python-version: ["3.11", "3.13"]
3237

3338
steps:
34-
- uses: actions/checkout@v6
39+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
3540

3641
- name: Set up Python ${{ matrix.python-version }}
37-
uses: actions/setup-python@v6
42+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
3843
with:
3944
python-version: ${{ matrix.python-version }}
4045
cache: pip
@@ -52,7 +57,7 @@ jobs:
5257

5358
- name: Upload coverage to Codecov
5459
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
55-
uses: codecov/codecov-action@v6
60+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6
5661
with:
5762
files: ./coverage.xml
5863
token: ${{ secrets.CODECOV_TOKEN }}
@@ -69,10 +74,10 @@ jobs:
6974
os: [ubuntu-latest, macos-latest, windows-latest]
7075

7176
steps:
72-
- uses: actions/checkout@v6
77+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
7378

7479
- name: Set up Python
75-
uses: actions/setup-python@v6
80+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
7681
with:
7782
python-version: "3.13"
7883
cache: pip
@@ -118,7 +123,7 @@ jobs:
118123
119124
- name: Upload build artifacts
120125
if: matrix.os == 'ubuntu-latest'
121-
uses: actions/upload-artifact@v7
126+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
122127
with:
123128
name: dist
124129
path: dist/
@@ -149,19 +154,19 @@ jobs:
149154
godot-version: "4.3.0"
150155

151156
steps:
152-
- uses: actions/checkout@v6
157+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
153158

154159
- name: Build plugin link
155160
shell: bash
156161
run: bash script/verify-worktree
157162

158-
- uses: chickensoft-games/setup-godot@v2
163+
- uses: chickensoft-games/setup-godot@f166999204a4f2722c6fe042fbaa3b3ea0d9c789 # v2
159164
with:
160165
version: ${{ matrix.godot-version }}
161166
use-dotnet: false
162167

163168
- name: Set up Python
164-
uses: actions/setup-python@v6
169+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
165170
with:
166171
python-version: "3.13"
167172
cache: pip
@@ -243,19 +248,19 @@ jobs:
243248
label: Windows
244249

245250
steps:
246-
- uses: actions/checkout@v6
251+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
247252

248253
- name: Build plugin link
249254
shell: bash
250255
run: bash script/verify-worktree
251256

252-
- uses: chickensoft-games/setup-godot@v2
257+
- uses: chickensoft-games/setup-godot@f166999204a4f2722c6fe042fbaa3b3ea0d9c789 # v2
253258
with:
254259
version: 4.6.2
255260
use-dotnet: false
256261

257262
- name: Set up Python
258-
uses: actions/setup-python@v6
263+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
259264
with:
260265
python-version: "3.13"
261266
cache: pip
@@ -306,13 +311,13 @@ jobs:
306311
label: Windows
307312

308313
steps:
309-
- uses: actions/checkout@v6
314+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
310315

311316
- name: Build plugin link
312317
shell: bash
313318
run: bash script/verify-worktree
314319

315-
- uses: chickensoft-games/setup-godot@v2
320+
- uses: chickensoft-games/setup-godot@f166999204a4f2722c6fe042fbaa3b3ea0d9c789 # v2
316321
with:
317322
version: 4.6.2
318323
use-dotnet: false
@@ -322,7 +327,7 @@ jobs:
322327
run: sudo apt-get update && sudo apt-get install -y xvfb
323328

324329
- name: Set up Python
325-
uses: actions/setup-python@v6
330+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
326331
with:
327332
python-version: "3.13"
328333
cache: pip

.github/workflows/close-issues-on-beta-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- name: Close issues referenced by closing keywords
39-
uses: actions/github-script@v7
39+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
4040
with:
4141
script: |
4242
const body = context.payload.pull_request.body || '';

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
id-token: write # required for PyPI OIDC
3333

3434
steps:
35-
- uses: actions/checkout@v6
35+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
3636

3737
- name: Verify ref is a version tag
3838
# Guard against a manual workflow_dispatch on a branch ref (e.g.
@@ -46,7 +46,7 @@ jobs:
4646
fi
4747
4848
- name: Set up Python
49-
uses: actions/setup-python@v6
49+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
5050
with:
5151
python-version: "3.13"
5252

@@ -67,7 +67,7 @@ jobs:
6767
run: python -m build
6868

6969
- name: Publish to PyPI
70-
uses: pypa/gh-action-pypi-publish@release/v1
70+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
7171
with:
7272
# Idempotent re-runs: if this version is already on PyPI (e.g. a
7373
# previous run published but a downstream job failed), skip the
@@ -84,7 +84,7 @@ jobs:
8484
needs: publish-pypi
8585

8686
steps:
87-
- uses: actions/checkout@v6
87+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
8888

8989
- name: Build plugin ZIP
9090
# Ship `addons/` + `godot-ai-LICENSE.txt` at the zip's top level. The
@@ -162,7 +162,7 @@ jobs:
162162
echo "Zip structure verified: addons/godot_ai/... + godot-ai-LICENSE.txt (multi-top)"
163163
164164
- name: Create GitHub Release
165-
uses: softprops/action-gh-release@v3
165+
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
166166
with:
167167
files: godot-ai-plugin.zip
168168
generate_release_notes: true

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,10 @@ test_project/tests/_mcp_test_*
6565

6666
# stormtest scratch artifacts (script/stormtest.py)
6767
_stormtest/
68+
69+
# Local audit / review reports (generated deliverables, not part of the repo)
70+
/security-audit*.html
71+
/robustness-review*.html
72+
73+
# Self-update smoke-test artifact dropped into the test project
74+
test_project/godot-ai-LICENSE.txt

0 commit comments

Comments
 (0)