
npmのtrusted publishingでdist-tag権限を任意設定にOpt-in dist-tag permissions for npm trusted publishing
匿名の公開いいねです。記事の保存・お気に入りではなく、Featured、Top 3、重要度、掲載順位には影響しません。仕組みとプライバシーAnonymous public likes are reactions, not saved articles or bookmarks. They do not affect Featured, Top 3, importance, or listing order.How it works and privacy
- npmのtrusted publishingに、dist-tag操作を許可する任意設定「Allow npm dist-tag」が加わった。
- 既定では無効で、OIDC短期認証情報だけでlatestやbetaを更新でき、長期トークンへの依存を減らせる。
- npm trusted publishing now offers an optional Allow npm dist-tag setting for tag management.
- Disabled by default, it lets OIDC workflows update latest, next, or beta without retaining a long-lived token.
本ページの本文と要約は AI による自動生成です。日本語版と英語版は言語ごとに独立して生成されるため、表現や詳しさが異なる場合があります。正確性は元記事 (github.blog) をご確認ください。The body and summaries are AI-generated independently for each language, so wording and detail may differ. Verify accuracy at the original source (github.blog).
要約と収集メタデータに基づく AI 解説。元記事全文の転載・翻訳ではありません。AI explainer based on the summaries and collected metadata, not a copy or translation of the full source article.
npmのtrusted publishingに、dist-tag操作を許可する任意設定「Allow npm dist-tag」が加わった。OIDCの短期認証情報を使い、長期アクセストークンを保持せずにリリース後やロールバック後のタグを管理できる点が重要だ。
dist-tag操作
新しい権限を有効にすると、バージョンをlatestへ昇格させたり、nextやbetaの参照先を更新したりできる。これらの操作には、長期アクセストークンではなく、trusted publishingで用いる短期のOIDC認証情報を利用する。
従来のtrusted publishingが対象としていたのは、公開とステージングまでだった。dist-tag操作は対象外だったため、公開処理をトークン不要のOIDCベースへ移行したメンテナーも、タグ管理のためだけに細かな権限を持つアクセストークンを残す必要があった。
既定は無効
「Allow npm dist-tag」はオプトイン方式で、新規と既存のどちらのtrusted publishing設定でも既定では無効となる。このため、設定に新しい操作能力が自動的に追加されることはない。dist-tagを管理したい場合に限り、設定ごとに明示的に許可する形だ。
公開権限と独立
dist-tag権限は、直接公開するための権限とは独立している。したがって、公開を直接行わずステージングだけに使う設定であっても、必要に応じてdist-tag管理を許可できる。公開やステージングの構成を変えず、タグ操作だけをOIDCの短期認証情報へ移せるようになった。
Trusted publishing configurations
npm trusted publishing configurations can now receive permission to manage dist-tags. This matters because maintainers can perform operations such as promoting a version to latest or updating next and beta pointers with short-lived OIDC credentials rather than retaining a long-lived access token for those tasks.
Short-lived OIDC credentials
Before this change, trusted publishing covered publishing and staging but did not cover dist-tag operations. Maintainers who had otherwise moved fully to token-free, OIDC-based workflows therefore still needed to keep a granular access token specifically for managing tags after a release or rollback.
With dist-tag management available through trusted publishing, those workflows can now update latest, next, or beta using their short-lived OIDC credentials. The change removes the stated need to retain a long-lived token solely for those post-release or rollback tag operations.
Allow npm dist-tag
The capability is controlled through an optional setting named Allow npm dist-tag. It is disabled by default for both newly created and existing trusted publishing configurations.
As a result, no configuration automatically receives permission to manage dist-tags. The setting must be explicitly enabled for each trusted publishing configuration that should have that capability. Configurations left unchanged continue without the new dist-tag permission.
Publishing and staging
Permission to manage dist-tags is independent of permission for direct publishing. A trusted publishing configuration does not need direct publishing capability in order to receive dist-tag management permission.
That separation means a staging-only configuration can also be granted the Allow npm dist-tag permission. Maintainers can therefore choose which trusted publishing configurations may update dist-tags without automatically expanding their direct publishing capabilities.
ポコとTECHガイドPoko & TECH Guide
ポコと当サイトのTECHガイドが、記事の要約と収集した情報から読みどころを語るAI生成の対話です。Poko and TECH Dashboard's own TECH Guide discuss the article's highlights in an AI-generated conversation based on its summary and collected source details.
- ポコPokonpmのパッケージを出す仕事では、普段のリリースやロールバックがどう変わるの?For people releasing npm packages, what changes in the usual release or rollback workflow?
- TECHガイドTECH Guide設定を有効にすれば、短期のOIDC認証情報でlatestやnext、betaを更新できるよ。長期トークンへの依存を減らせるんだ。With the setting enabled, workflows can update latest, next, or beta using short-lived OIDC credentials, reducing reliance on a long-lived token.
- ポコPoko前はOIDCだけではできなかったの? タグの更新用に別のものが必要だった?Couldn’t OIDC handle that before? Did maintainers need something separate just to update tags?
- TECHガイドTECH Guide以前のtrusted publishingは公開とステージングまでで、dist-tag操作は対象外だったよ。そのためタグ管理には個別のアクセストークンが必要だったんだ。Previously, trusted publishing covered publishing and staging, but not dist-tag operations. Maintainers still needed a granular access token for tag management.
- ポコPokoいちばんの収穫は、設定すればタグ更新のためだけに長期トークンを残さなくてよくなることだね。So the big takeaway is that enabling it can remove the need to keep a long-lived token solely for tag updates.
- TECHガイドTECH Guideそうだね。既定では無効だから、必要な構成だけで許可する点に注目したいね。ステージング専用の構成にも付けられるよ。Right. It’s off by default, so watch which configurations explicitly receive permission. Even a staging-only configuration can be granted dist-tag management.





