Skip to content

Commit 593d788

Browse files
keiloktqlclaude
andauthored
P-2208: Harden github actions (#32)
* chore: harden GitHub Actions (P-2208) - dependabot: 7-day cooldown on github-actions + npm ecosystems - ci.yml: persist-credentials: false on all 4 checkouts; explicit pnpm version: 11 - release.yml: persist-credentials: false; drop pnpm cache from setup-node (cache-poisoning mitigation); quote variable to fix SC2086; explicit pnpm version: 11 Refs P-2208. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(ci): remove redundant pnpm version pin from action-setup The `with: version: 11` on `pnpm/action-setup` conflicts with `packageManager: pnpm@11.1.1` in package.json — the action refuses both and errors with ERR_PNPM_BAD_PM_VERSION. Drop the action input and let action-setup resolve from packageManager, which is the more precise pin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * release: remove redundant zizmor cache-poisoning ignore Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1bdb311 commit 593d788

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7+
cooldown:
8+
default-days: 7
79

810
- package-ecosystem: "npm"
911
directory: "/"
1012
schedule:
1113
interval: "weekly"
1214
open-pull-requests-limit: 10
15+
cooldown:
16+
default-days: 7

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
persist-credentials: false
2123

2224
- name: Setup pnpm
2325
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
@@ -45,6 +47,8 @@ jobs:
4547
steps:
4648
- name: Checkout
4749
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
50+
with:
51+
persist-credentials: false
4852

4953
- name: Setup pnpm
5054
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
@@ -66,6 +70,8 @@ jobs:
6670
steps:
6771
- name: Checkout
6872
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
73+
with:
74+
persist-credentials: false
6975

7076
- name: Setup pnpm
7177
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
@@ -90,6 +96,8 @@ jobs:
9096
steps:
9197
- name: Checkout
9298
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
99+
with:
100+
persist-credentials: false
93101

94102
- name: Setup pnpm
95103
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818
with:
1919
fetch-depth: 0 # Fetch all history for changelog generation
20+
persist-credentials: false
2021

2122
- name: Verify tag is on main branch
2223
env:
@@ -40,8 +41,8 @@ jobs:
4041
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4142
with:
4243
node-version: "22.14.0"
43-
cache: 'pnpm'
4444
# No registry-url - using OIDC trusted publishing instead
45+
# No cache - mitigates cache-poisoning risk in publish workflow
4546

4647
- name: Update npm for trusted publishing
4748
run: npm install -g npm@latest
@@ -111,7 +112,7 @@ jobs:
111112
echo "Generating changelog from $PREV_TAG to $GITHUB_REF_NAME"
112113
# Extract commits with PR numbers and format them
113114
# Use tab as delimiter to safely handle semicolons and special characters
114-
COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"%s %h" --no-merges)
115+
COMMITS=$(git log "${PREV_TAG}..HEAD" --pretty=format:"%s %h" --no-merges)
115116
else
116117
echo "No previous tag found, using all commits"
117118
COMMITS=$(git log --pretty=format:"%s %h" --no-merges)

0 commit comments

Comments
 (0)