Skip to content

Commit 6ec4d55

Browse files
committed
fix: enable npm provenance publishing
1 parent efc8460 commit 6ec4d55

File tree

7 files changed

+38
-0
lines changed

7 files changed

+38
-0
lines changed

.github/workflows/tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ name: Node.js CI
55

66
on:
77
push:
8+
branches-ignore:
9+
- 'gh-pages'
810
pull_request:
911
workflow_dispatch:
1012
inputs:
1113
git-ref:
1214
description: Git Ref (Optional)
1315
required: false
1416

17+
permissions:
18+
contents: read
19+
1520
jobs:
1621
tests:
22+
permissions:
23+
contents: read # for actions/checkout to fetch code
1724
runs-on: ${{ matrix.distro }}
1825
strategy:
1926
matrix:
@@ -76,6 +83,11 @@ jobs:
7683
token: ${{ secrets.CODECOV_TOKEN }}
7784

7885
publish:
86+
permissions:
87+
contents: write # for actions/checkout to fetch code and for semantic-release to push commits, release releases and tags
88+
issues: write # for semantic-release to comment on and close issues
89+
pull-requests: write # for semantic-release to comment on and close pull requests
90+
id-token: write # for semantic-release to enable use of OIDC for npm provenance
7991
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || startsWith(github.ref, 'refs/heads/old')
8092
needs: [tests]
8193
runs-on: ubuntu-latest
@@ -104,4 +116,5 @@ jobs:
104116
105117
env:
106118
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119+
# replace with trusted-publishing once available, see https://github.com/semantic-release/npm/issues/958
107120
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

packages/mongodb-memory-server-core/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
"url": "https://github.com/typegoose/mongodb-memory-server/issues"
3232
},
3333
"homepage": "https://github.com/typegoose/mongodb-memory-server",
34+
"publishConfig": {
35+
"access": "public",
36+
"provenance": true
37+
},
3438
"devDependencies": {
3539
"@types/debug": "^4.1.12",
3640
"@types/find-cache-dir": "^3.2.1",
@@ -56,6 +60,7 @@
5660
"tslib": "^2.8.1",
5761
"yauzl": "^3.2.0"
5862
},
63+
5964
"scripts": {
6065
"clean": "rimraf tmp lib build coverage node_modules/.cache",
6166
"build": "rimraf ./lib && tsc -p ./tsconfig.build.json",

packages/mongodb-memory-server-global-4.0/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
"mongodb-prebuilt",
2525
"mongomem"
2626
],
27+
"publishConfig": {
28+
"access": "public",
29+
"provenance": true
30+
},
2731
"dependencies": {
2832
"mongodb-memory-server-core": "10.2.2",
2933
"tslib": "^2.8.1"

packages/mongodb-memory-server-global-4.2/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
"mongodb-prebuilt",
2525
"mongomem"
2626
],
27+
"publishConfig": {
28+
"access": "public",
29+
"provenance": true
30+
},
2731
"dependencies": {
2832
"mongodb-memory-server-core": "10.2.2",
2933
"tslib": "^2.8.1"

packages/mongodb-memory-server-global-4.4/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
"mongodb-prebuilt",
2525
"mongomem"
2626
],
27+
"publishConfig": {
28+
"access": "public",
29+
"provenance": true
30+
},
2731
"dependencies": {
2832
"mongodb-memory-server-core": "10.2.2",
2933
"tslib": "^2.8.1"

packages/mongodb-memory-server-global/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
"mongodb-prebuilt",
2424
"mongomem"
2525
],
26+
"publishConfig": {
27+
"access": "public",
28+
"provenance": true
29+
},
2630
"dependencies": {
2731
"mongodb-memory-server-core": "10.2.2",
2832
"tslib": "^2.8.1"

packages/mongodb-memory-server/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
"mongodb-prebuilt",
2424
"mongomem"
2525
],
26+
"publishConfig": {
27+
"access": "public",
28+
"provenance": true
29+
},
2630
"dependencies": {
2731
"mongodb-memory-server-core": "10.2.2",
2832
"tslib": "^2.8.1"

0 commit comments

Comments
 (0)