Skip to content

Commit f424cef

Browse files
authored
ci(package): npm package provenance (#991)
1 parent 471349f commit f424cef

File tree

4 files changed

+39
-1
lines changed

4 files changed

+39
-1
lines changed

Diff for: .github/workflows/publish.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: publish to npmjs
2+
on:
3+
release:
4+
types: [prereleased, released]
5+
jobs:
6+
build-and-publish:
7+
# prevents this action from running on forks
8+
if: github.repository == 'chimurai/http-proxy-middleware'
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '20.x'
18+
registry-url: 'https://registry.npmjs.org'
19+
20+
- name: Install Dependencies
21+
run: yarn install
22+
23+
- name: Publish to NPM (beta)
24+
if: 'github.event.release.prerelease'
25+
run: npm publish --provenance --access public --tag beta
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28+
29+
- name: Publish to NPM (stable)
30+
if: '!github.event.release.prerelease'
31+
run: npm publish --provenance --access public
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Diff for: .npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
package-lock=false
2+
provenance=true

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- fix(type): fix RequestHandler return type
66
- refactor(errors): improve pathFilter error message
77
- fix(logger-plugin): fix missing target port
8+
- ci(package): npm package provenance
89

910
## [v3.0.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v3.0.0)
1011

Diff for: package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "http-proxy-middleware",
3-
"version": "3.0.0",
3+
"version": "3.0.1-beta.0",
44
"description": "The one-liner node.js proxy middleware for connect, express, next.js and more",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -22,6 +22,9 @@
2222
"prepack": "yarn clean && yarn test && yarn build",
2323
"spellcheck": "npx --yes cspell --show-context --show-suggestions '**/*.*'"
2424
},
25+
"publishConfig": {
26+
"provenance": true
27+
},
2528
"repository": {
2629
"type": "git",
2730
"url": "https://github.com/chimurai/http-proxy-middleware.git"

0 commit comments

Comments
 (0)