ci: npm publish を release-tag workflow の後続ジョブに統合#55
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced May 17, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm-publish.yamlを削除し、publish 処理をrelease-tag.yaml内のpublishジョブとして統合release-tagジョブにversion/createdの outputs を追加publishジョブはneeds: release-tag+if: created == 'true'で、新規タグ作成時のみ実行contents: write/ publish 用id-token: write)設計の背景
PR #52 で publish を独立 workflow に分離したが、
release: publishedトリガーは「GITHUB_TOKENが起こしたイベントは他 workflow をトリガーしない」という GitHub の仕様で発火しない。このため自動 publish が機能せず、workflow_dispatchによる手動実行が事実上必須になっていた。publish を同一 workflow の後続ジョブ(
needs: release-tag)にすれば、ジョブ間依存はクロス workflow トリガー制約の対象外となり、自動 publish がそのまま動作する。仕様回避のための長いコメントとworkflow_dispatchフォールバックも不要になる。検討した代替案
release-tag.yamlにworkflow_dispatchを追加して手動 publish 経路を残す案: 再 publish の保険にはなるが、現状GITHUB_TOKEN起因の自動 release では使えていない経路であり、自動経路に一本化するシンプルさを優先して見送った。npm-publish.yamlをworkflow_dispatch専用の手動ツールとして残す案: 同上の理由で不要と判断。Test plan
package.jsonの version 変更を main に push し、tag/release 作成 → publish が同一 run 内で連結することを確認publishジョブがスキップされることを確認