Skip to content

Commit a020237

Browse files
authored
chore: harden supply chain config (#34)
## Summary - Fix the esbuild advisory by upgrading the direct dev dependency and forcing transitive esbuild resolution to 0.28.1. - Move pnpm build allowlisting into pnpm-workspace.yaml and add minimum release age hardening. - Add grouped Dependabot updates for npm and GitHub Actions with cooldowns to avoid high PR volume. - Harden workflows by removing the release PAT fallback, replacing pull_request_target, disabling setup-node package-manager cache for release artifacts, refreshing pinned Actions, and removing zizmor findings. ## Validation - `pnpm audit --json` reports 0 advisories. - `osv-scanner scan source -r .` reports no issues. - `zizmor .github/workflows/` reports no findings. - `pinact run --diff --check --update --min-age 7` exits cleanly. - `pnpm check` fails in this sandbox because `sqlite3` is not installed (`spawn sqlite3 ENOENT`); 100 tests passed before the sqlite3-dependent failures. Prompted by: @grandizzy
1 parent 130319b commit a020237

10 files changed

Lines changed: 212 additions & 433 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
wallet-cli: patch
3+
---
4+
5+
Harden supply chain configuration, dependency updates, and release workflows.

.github/dependabot.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
time: "10:00"
9+
timezone: Etc/UTC
10+
cooldown:
11+
default-days: 7
12+
open-pull-requests-limit: 3
13+
groups:
14+
production-dependencies:
15+
dependency-type: production
16+
update-types:
17+
- patch
18+
- minor
19+
development-dependencies:
20+
dependency-type: development
21+
update-types:
22+
- patch
23+
- minor
24+
major-dependencies:
25+
update-types:
26+
- major
27+
28+
- package-ecosystem: github-actions
29+
directory: /
30+
schedule:
31+
interval: weekly
32+
day: monday
33+
time: "10:30"
34+
timezone: Etc/UTC
35+
cooldown:
36+
default-days: 7
37+
open-pull-requests-limit: 2
38+
groups:
39+
github-actions:
40+
patterns:
41+
- "*"

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,15 @@ jobs:
9191
TEMPO_WALLET_PACKAGE_DIR: artifacts
9292
TEMPO_WALLET_PACKAGE_OUTPUT: artifacts/${{ matrix.package }}-${{ matrix.build.suffix }}
9393
steps:
94-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
94+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
9595
with:
9696
persist-credentials: false
9797

9898
- name: Setup Node.js
9999
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
100100
with:
101101
node-version: "22"
102+
package-manager-cache: false
102103

103104
- name: Setup pnpm
104105
run: |
@@ -198,7 +199,7 @@ jobs:
198199
VERSION: ${{ needs.parse-tag.outputs.version }}
199200
RELEASE_TAG: ${{ needs.parse-tag.outputs.release_tag }}
200201
steps:
201-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
202+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
202203
with:
203204
persist-credentials: false
204205

@@ -230,14 +231,14 @@ jobs:
230231
run: gh release upload "$RELEASE_TAG" artifacts/* --clobber
231232

232233
- name: Checkout release signing tool
233-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
234+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
234235
with:
235236
repository: tempoxyz/wallet
236237
path: wallet-release-tools
237238
persist-credentials: false
238239

239240
- name: Setup Rust
240-
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
241+
run: rustup default stable
241242

242243
- name: Build release signer
243244
run: cargo build --release -p tempo-sign

.github/workflows/changelog-generate.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Changelog Generate
22

3-
# pull_request_target runs in the context of the base branch, giving access
4-
# to secrets even for fork PRs. This workflow only writes to same-repo branches
5-
# and never executes code from forked PRs.
63
on:
7-
pull_request_target:
4+
pull_request:
85
types: [labeled]
96

107
concurrency: ${{ github.workflow }}-${{ github.event.number }}
@@ -13,7 +10,7 @@ permissions: {}
1310

1411
jobs:
1512
generate:
16-
if: startsWith(github.event.label.name, 'changelog:')
13+
if: startsWith(github.event.label.name, 'changelog:') && github.event.pull_request.head.repo.full_name == github.repository
1714
runs-on: ubuntu-latest
1815
environment: release
1916
permissions: {}
@@ -57,7 +54,7 @@ jobs:
5754
permission-pull-requests: write
5855
permission-metadata: read
5956

60-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
6158
if: steps.source.outputs.same_repo == 'true'
6259
with:
6360
repository: ${{ github.event.pull_request.head.repo.full_name }}

.github/workflows/changelog.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
check:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1717
with:
1818
fetch-depth: 0
1919
persist-credentials: false
@@ -42,8 +42,10 @@ jobs:
4242
4343
- name: Check changelog entry exists
4444
if: steps.changes.outputs.requires_changelog == 'true'
45+
env:
46+
HAS_CHANGELOG: ${{ steps.changes.outputs.has_changelog }}
4547
run: |
46-
if [ "${{ steps.changes.outputs.has_changelog }}" != "true" ]; then
48+
if [ "$HAS_CHANGELOG" != "true" ]; then
4749
echo "::error::A changelog entry is required for this PR. Add a .changelog/*.md file."
4850
exit 1
4951
fi

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
name: Code
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
3535
with:
3636
persist-credentials: false
3737

3838
- name: Setup pnpm
39-
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
39+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
4040

4141
- name: Setup Node.js
4242
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
@@ -54,12 +54,12 @@ jobs:
5454
name: Types
5555
runs-on: ubuntu-latest
5656
steps:
57-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
5858
with:
5959
persist-credentials: false
6060

6161
- name: Setup pnpm
62-
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
62+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
6363

6464
- name: Setup Node.js
6565
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
@@ -80,12 +80,12 @@ jobs:
8080
name: Tests
8181
runs-on: ubuntu-latest
8282
steps:
83-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
83+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
8484
with:
8585
persist-credentials: false
8686

8787
- name: Setup pnpm
88-
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
88+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
8989

9090
- name: Setup Node.js
9191
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
contents: write
1818
pull-requests: write
1919
steps:
20-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
2121
with:
2222
fetch-depth: 0
2323
persist-credentials: false
@@ -51,7 +51,6 @@ jobs:
5151
if: steps.diff.outputs.changed == 'true'
5252
env:
5353
GH_TOKEN: ${{ github.token }}
54-
PUSH_TOKEN: ${{ secrets.GH_PAT || github.token }}
5554
run: |
5655
set -euo pipefail
5756
VERSION=$(node -p "require('./package.json').version")
@@ -61,7 +60,7 @@ jobs:
6160
git checkout -B "$BRANCH"
6261
git add package.json CHANGELOG.md .changelog
6362
git commit -m "chore: release ${VERSION}"
64-
git push --force "https://x-access-token:${PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:"$BRANCH"
63+
git push --force "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:"$BRANCH"
6564
6665
PR_NUMBER=$(gh pr list --head "$BRANCH" --json number --jq '.[0].number // empty')
6766
if [ -n "$PR_NUMBER" ]; then
@@ -78,7 +77,7 @@ jobs:
7877
actions: write
7978
contents: write
8079
steps:
81-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
80+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
8281
with:
8382
fetch-depth: 0
8483
persist-credentials: false

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,11 @@
4646
"devDependencies": {
4747
"@types/node": "25.9.2",
4848
"@yao-pkg/pkg": "6.20.0",
49-
"esbuild": "0.28.0",
49+
"esbuild": "0.28.1",
5050
"tsx": "4.22.4",
5151
"typescript": "6.0.3",
5252
"vitest": "4.1.8",
5353
"vp": "npm:vite-plus@0.1.24"
5454
},
55-
"packageManager": "pnpm@11.0.8",
56-
"pnpm": {
57-
"onlyBuiltDependencies": [
58-
"esbuild"
59-
]
60-
}
55+
"packageManager": "pnpm@11.0.8"
6156
}

0 commit comments

Comments
 (0)