-
Notifications
You must be signed in to change notification settings - Fork 3
Migrate npm publish to trusted publishers (OIDC) #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
ac50de4
91d79b5
b08234c
5dd57f6
19f2808
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,17 +5,23 @@ on: | |
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '24' | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Get Node.js version | ||
| id: node-version | ||
| run: | | ||
| echo "::set-output name=version::$(node --version)" | ||
| echo "version=$(node --version)" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Cache node_modules | ||
| uses: actions/cache@v4 | ||
| id: cache-node-modules | ||
|
|
@@ -26,18 +32,14 @@ jobs: | |
| - name: Install dependencies | ||
| run: npm install | ||
| if: steps.cache-node-modules.outputs.cache-hit != 'true' | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.ENVOYBOT_PERSONAL_ACCESS_TOKEN }} | ||
|
|
||
| - run: npm publish --tag beta --access public | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.ENVOY_NPM_AUTOMATION_TOKEN }} | ||
| - run: npm publish --access public | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This publish command uses OIDC but omits Useful? React with 👍 / 👎.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://docs.npmjs.com/trusted-publishers#automatic-provenance-generation
https://www.npmjs.com/package/@envoy/envoy-integrations-sdk/v/2.5.1#provenance
JustWalters marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Setup .npmrc file to publish to npm | ||
| # Setup .npmrc file to publish to GitHub Packages | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| registry-url: 'https://npm.pkg.github.com' | ||
|
|
||
| - run: npm publish --tag beta | ||
| - run: npm publish | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||

Uh oh!
There was an error while loading. Please reload this page.