Skip to content

Commit

Permalink
ci(package): npm package provenance (#991)
Browse files Browse the repository at this point in the history
  • Loading branch information
chimurai committed Apr 20, 2024
1 parent 471349f commit f424cef
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,33 @@
name: publish to npmjs
on:
release:
types: [prereleased, released]
jobs:
build-and-publish:
# prevents this action from running on forks
if: github.repository == 'chimurai/http-proxy-middleware'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: yarn install

- name: Publish to NPM (beta)
if: 'github.event.release.prerelease'
run: npm publish --provenance --access public --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to NPM (stable)
if: '!github.event.release.prerelease'
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .npmrc
@@ -1 +1,2 @@
package-lock=false
provenance=true
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@
- fix(type): fix RequestHandler return type
- refactor(errors): improve pathFilter error message
- fix(logger-plugin): fix missing target port
- ci(package): npm package provenance

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

Expand Down
5 changes: 4 additions & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "http-proxy-middleware",
"version": "3.0.0",
"version": "3.0.1-beta.0",
"description": "The one-liner node.js proxy middleware for connect, express, next.js and more",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -22,6 +22,9 @@
"prepack": "yarn clean && yarn test && yarn build",
"spellcheck": "npx --yes cspell --show-context --show-suggestions '**/*.*'"
},
"publishConfig": {
"provenance": true
},
"repository": {
"type": "git",
"url": "https://github.com/chimurai/http-proxy-middleware.git"
Expand Down

0 comments on commit f424cef

Please sign in to comment.