Skip to content

Conversation

@hortison
Copy link
Contributor

@hortison hortison commented Jan 9, 2026

Signed-off-by: Lee Calcote lee.calcote@layer5.io

Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
Copilot AI review requested due to automatic review settings January 9, 2026 14:07
@hortison hortison merged commit 54efde7 into master Jan 9, 2026
@hortison hortison deleted the leecalcote/ci/npm-oidc branch January 9, 2026 14:07
@github-actions github-actions bot added the area/ci Continuous integration | Build and release label Jan 9, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request aims to migrate the npm package publishing workflow from token-based authentication to OIDC (OpenID Connect) trusted publishing, which enhances security by eliminating the need for long-lived access tokens.

Key changes:

  • Addition of OIDC permissions (id-token: write) at workflow and job levels
  • Update to Node.js version 24 and ubuntu-24.04 runners
  • Modification of npm publish command to include --provenance flag for attestation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 14 to +19
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
runs-on: ubuntu-24.04

- uses: actions/setup-node@v3
with:
node-version: '20.x'
permissions:
id-token: write # Required for OIDC trusted publishing
contents: write
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The build job is now empty with no steps defined. An empty job will fail to execute. Either remove this job entirely or add the necessary steps (checkout and setup-node at minimum).

Copilot uses AI. Check for mistakes.
packages: write
steps:
- uses: actions/checkout@v4

Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The publish job is missing the checkout step (actions/checkout). This step is required to check out the repository code before setting the package version, installing dependencies, building, and publishing. Without it, the workflow will fail as there will be no code to work with.

Suggested change
- uses: actions/checkout@v4

Copilot uses AI. Check for mistakes.
publish-gpr:
needs: build
runs-on: ubuntu-latest
publish:
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

There's a syntax error: incorrect indentation for the publish job. The job name should align with 'build' above (2 spaces), but it has 3 spaces. This will cause a YAML parsing error.

Suggested change
publish:
publish:

Copilot uses AI. Check for mistakes.
Comment on lines 42 to +43
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: '' # Explicitly empty for install
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

Setting NODE_AUTH_TOKEN to an empty string will prevent npm authentication. For OIDC trusted publishing to work, you should either omit the NODE_AUTH_TOKEN environment variable entirely or configure it properly. When using OIDC with --provenance flag, npm will use the OIDC token automatically and NODE_AUTH_TOKEN should not be set.

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The publish job permissions include 'packages: write' which is for GitHub Packages, but this workflow is publishing to npm registry. For OIDC trusted publishing to npm, you need 'id-token: write' permission instead. The 'packages: write' permission should be removed as it's not relevant for npm publishing.

Suggested change
packages: write
id-token: write # Required for OIDC trusted publishing to npm

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Continuous integration | Build and release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants