Skip to content

Commit a361b0a

Browse files
authored
Add npm publishing provenance (#1367)
1 parent 6fe0372 commit a361b0a

File tree

7 files changed

+44
-5
lines changed

7 files changed

+44
-5
lines changed

.changeset/soft-guests-film.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@keystar/ui': patch
3+
'@keystatic/astro': patch
4+
'@keystatic/create': patch
5+
'@keystatic/core': patch
6+
'@keystatic/next': patch
7+
'@keystatic/remix': patch
8+
'@keystatic/templates-astro': patch
9+
'@keystatic/templates-nextjs': patch
10+
'@keystatic/templates-remix': patch
11+
---
12+
13+
Add npm publishing provenance

.github/workflows/publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Publish
33
on:
44
workflow_dispatch:
55

6+
permissions:
7+
contents: write
8+
id-token: write
9+
610
jobs:
711
publish:
812
name: Publish
@@ -27,5 +31,6 @@ jobs:
2731
run: pnpm changeset publish
2832
env:
2933
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
34+
NPM_CONFIG_PROVENANCE: true
3035

3136
- run: git push origin --follow-tags

.github/workflows/publish_snapshot.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Publish (Snapshot)
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
tag:
7-
description: 'The npm tag to publish to'
8-
required: true
5+
6+
permissions:
7+
contents: write
8+
id-token: write
99

1010
jobs:
1111
publish_snapshot:
@@ -33,9 +33,10 @@ jobs:
3333
- run: pnpm build:packages
3434

3535
- name: npm publish, git tag
36-
run: pnpm changeset publish --tag ${{ inputs.tag }}
36+
run: pnpm changeset publish --tag test
3737
env:
3838
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
39+
NPM_CONFIG_PROVENANCE: true
3940

4041
# reset, then push the dangling commit
4142
- name: git push

design-system/pkg/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"license": "MIT AND Apache-2.0",
55
"main": "",
66
"module": "",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/Thinkmill/keystatic/",
10+
"directory": "design-system/pkg"
11+
},
712
"scripts": {
813
"build-icons": "tsx build-icons.ts && cd ../.. && pnpm preconstruct fix"
914
},

templates/astro/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"name": "@keystatic/templates-astro",
33
"version": "0.0.54",
44
"license": "MIT",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/Thinkmill/keystatic/",
8+
"directory": "templates/astro"
9+
},
510
"scripts": {
611
"dev": "astro dev",
712
"start": "astro dev",

templates/nextjs/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
"name": "@keystatic/templates-nextjs",
33
"version": "0.0.55",
44
"license": "MIT",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/Thinkmill/keystatic/",
8+
"directory": "templates/nextjs"
9+
},
510
"scripts": {
611
"build": "next build",
712
"dev": "next dev",

templates/remix/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"type": "module",
44
"version": "0.0.42",
55
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/Thinkmill/keystatic/",
9+
"directory": "templates/remix"
10+
},
611
"scripts": {
712
"build": "remix vite:build",
813
"dev": "remix vite:dev",

0 commit comments

Comments
 (0)