Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,18 +32,16 @@ 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add provenance flag to npm trusted publish

This publish command uses OIDC but omits --provenance, so npm will publish without generating a provenance attestation even though this migration is explicitly targeting trusted publishing. I verified CLI semantics via npm publish --help (where --provenance is optional) and npm config get provenance (default false), so in this workflow the release can succeed but still miss the supply-chain metadata expected from trusted publishers.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://docs.npmjs.com/trusted-publishers#automatic-provenance-generation

When you publish using trusted publishing, npm automatically generates and publishes provenance attestations for your package. This happens by default—you don't need to add the --provenance flag to your publish command.

https://www.npmjs.com/package/@envoy/envoy-integrations-sdk/v/2.5.1#provenance
image

Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description calls out verifying provenance attestation, but the publish command doesn’t explicitly enable provenance generation. To avoid relying on npm’s default behavior (which can change across npm versions), consider making it explicit via npm publish --provenance ... or setting NPM_CONFIG_PROVENANCE=true for the publish step.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with relying on default behavior here.

if: ${{ !github.event.release.prerelease }}

# 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
if: ${{ !github.event.release.prerelease }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading