Skip to content

use oidc for npm publish#412

Merged
cp-20 merged 3 commits intomasterfrom
use-oidc-to-npm-publish
Sep 8, 2025
Merged

use oidc for npm publish#412
cp-20 merged 3 commits intomasterfrom
use-oidc-to-npm-publish

Conversation

@Pugma
Copy link
Copy Markdown
Contributor

@Pugma Pugma commented Sep 5, 2025

as titled
merge 前に、こちら↓ の手順を npm 管理画面側からやっておく必要があります
https://docs.npmjs.com/trusted-publishers#for-github-actions

ついでに検証時に grep-P が mac 環境で使えなくて落ちていたので、それも json 出力を使って記述を簡略化しました

@Pugma Pugma requested a review from Copilot September 5, 2025 09:22
Copy link
Copy Markdown

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 PR updates the npm publish workflow to use OpenID Connect (OIDC) authentication instead of token-based authentication. The changes modernize the authentication method and simplify several shell commands by using JSON output with jq parsing.

  • Switches from NPM_TOKEN secret to OIDC authentication for npm publish
  • Refactors shell commands to use JSON output with jq instead of complex grep/sed patterns
  • Adds id-token: write permission required for OIDC authentication

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -70,5 +71,4 @@ jobs:
git push --tags
npm publish --access public
Copy link

Copilot AI Sep 5, 2025

Choose a reason for hiding this comment

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

The workflow removes NODE_AUTH_TOKEN but doesn't configure npm to use OIDC authentication. You need to add npm config set //registry.npmjs.org/:_authToken=$NPM_TOKEN where NPM_TOKEN is automatically provided by GitHub's OIDC, or configure the registry authentication in a separate step before publishing.

Copilot uses AI. Check for mistakes.
@Pugma Pugma requested a review from cp-20 September 5, 2025 13:02
@cp-20 cp-20 merged commit 0978688 into master Sep 8, 2025
4 checks passed
@cp-20 cp-20 deleted the use-oidc-to-npm-publish branch September 8, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants