Skip to content

Commit fc1101d

Browse files
committed
chore(ci): split release.yml into build/publish/release-notes/notify jobs
Splits the single release job into 4 jobs so the `id-token: write` scope is held only by a publish job that runs `npm publish` exclusively (no install/test/build/exec). - build (no id-token): install, typecheck, test, build, validate, upload dist/ + package metadata as artifact. - publish (id-token: write): download artifact, npm publish --ignore-scripts. - release-notes (contents: write, no id-token): npx changelogithub. - notify (if: always()): slack notification, aggregates needs.*.result. Resolves the supply-chain audit oidc-publish-fused finding. Motivated by the TanStack npm supply-chain compromise (May 2026).
1 parent e24f371 commit fc1101d

1 file changed

Lines changed: 49 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
name: Release
22

33
permissions:
4-
id-token: write # Required for OIDC
5-
contents: write
4+
contents: read
65

76
on:
87
push:
98
tags:
109
- 'v*'
1110

1211
jobs:
13-
release:
12+
build:
1413
runs-on: ubuntu-latest
1514
steps:
1615
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -24,10 +23,8 @@ jobs:
2423
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
2524
with:
2625
node-version: 24
27-
registry-url: 'https://registry.npmjs.org'
2826
cache: pnpm
2927

30-
3128
- name: 📥 Install dependencies
3229
run: pnpm install --frozen-lockfile
3330

@@ -64,21 +61,64 @@ jobs:
6461
6562
echo "✅ Build artifacts validation passed"
6663
64+
- name: 📤 Upload package artifact
65+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
66+
with:
67+
name: package
68+
path: |
69+
dist/
70+
package.json
71+
README.md
72+
LICENSE
73+
retention-days: 1
74+
if-no-files-found: error
75+
76+
publish:
77+
needs: build
78+
runs-on: ubuntu-latest
79+
permissions:
80+
id-token: write
81+
contents: read
82+
steps:
83+
- name: ⎔ Setup Node.js
84+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
85+
with:
86+
node-version: 24
87+
registry-url: 'https://registry.npmjs.org'
88+
89+
- name: 📥 Download package artifact
90+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
91+
with:
92+
name: package
93+
6794
- name: 📦 Publish to NPM
68-
run: pnpm publish --no-git-checks
95+
run: npm publish --ignore-scripts
6996
env:
7097
NODE_AUTH_TOKEN: "" # Clear placeholder set by setup-node to enable OIDC
7198

99+
release-notes:
100+
needs: publish
101+
runs-on: ubuntu-latest
102+
permissions:
103+
contents: write
104+
steps:
105+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
106+
with:
107+
fetch-depth: 0
72108

73109
- name: 📝 Update Changelog
74110
run: npx changelogithub
75111
env:
76-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
112+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77113

114+
notify:
115+
needs: [build, publish, release-notes]
116+
if: always()
117+
runs-on: ubuntu-latest
118+
steps:
78119
- name: 📣 Notify release result
79-
if: always()
80120
uses: marimo-team/internal-gh-actions/release-notification@ba06d4db1f3c5c9b86983ce409e57196f8376777 # main
81121
with:
82-
status: ${{ job.status }}
122+
status: ${{ contains(needs.*.result, 'failure') && 'failure' || 'success' }}
83123
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_RELEASES }}
84124
artifact-url: "https://npmjs.com/package/@marimo-team/codemirror-sql"

0 commit comments

Comments
 (0)