Update GitHub Actions workflow for NPM package publishing: rename job, adjust permissions, update Node.js and pnpm versions, and switch to pnpm for publishing.#6
Conversation
…, adjust permissions, update Node.js and pnpm versions, and switch to pnpm for publishing.
WalkthroughThis PR modernizes the NPM publishing workflow by migrating from manual token-based authentication to NPM's trusted publishing with OIDC. The workflow now leverages GitHub's OIDC provider for secure, automated authentication, eliminating the need to manage NPM_TOKEN secrets. The update includes upgrading to newer action versions (checkout@v4, pnpm@v2), adding pnpm caching for improved performance, and downgrading Node.js to v20 for compatibility. A critical addition is the installation of npm@11.6.4, which provides native support for trusted publishing. The publish command switches from npm to pnpm with automatic provenance generation, enhancing supply chain security. Changes
Sequence DiagramThis diagram shows the interactions between components: sequenceDiagram
actor Dev as Developer
participant GHA as GitHub Actions
participant OIDC as GitHub OIDC Provider
participant NPM as NPM Registry
participant Repo as Repository
Dev->>GHA: Trigger workflow_dispatch
activate GHA
GHA->>Repo: Checkout code (fetch-depth: 0)
Repo-->>GHA: Source code
GHA->>GHA: Setup pnpm (v9.15.4)
GHA->>GHA: Setup Node.js (v20)
GHA->>GHA: Install npm v11.6.4
Note over GHA: npm 11.5.1+ required for<br/>trusted publishing
GHA->>GHA: pnpm install
GHA->>GHA: pnpm run build
GHA->>OIDC: Request OIDC token
Note over GHA,OIDC: Uses id-token: write permission
OIDC-->>GHA: OIDC token
GHA->>NPM: pnpm publish --access public
Note over GHA,NPM: Includes OIDC token for authentication
NPM->>NPM: Verify OIDC token
NPM->>NPM: Generate provenance automatically
NPM-->>GHA: Publish success
deactivate GHA
Note over Dev,NPM: New flow: OIDC-based trusted publishing<br/>Old flow: Used NODE_AUTH_TOKEN secret
🔗 Cross-Repository Impact AnalysisEnable automatic detection of breaking changes across your dependent repositories. → Set up now Learn more about Cross-Repository AnalysisWhat It Does
How to Enable
Benefits
Note for WindsurfPlease change the default marketplace provider to the following in the windsurf settings:Marketplace Extension Gallery Service URL: https://marketplace.visualstudio.com/_apis/public/gallery Marketplace Gallery Item URL: https://marketplace.visualstudio.com/items Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts belowEmoji Descriptions:
Interact with the Bot:
Also you can trigger various commands with the bot by doing The current supported commands are
More commands to be added soon. |
EntelligenceAI PR Summary
Migrates NPM publishing workflow from manual token authentication to OIDC-based trusted publishing for enhanced security and automation.
pnpm publish --access publicwith automatic provenance