ci: release workflow に workflow_dispatch を追加#52
Merged
Conversation
release-tag workflow が GITHUB_TOKEN で GitHub release を作成すると release: published イベントが他の workflow をトリガーしないため、 npm publish の release workflow が起動しない。 手動でも publish できるよう workflow_dispatch を追加する。publish する バージョンは release イベント・手動実行のどちらもチェックアウトした package.json から取得するため、入力は不要。 - checkout の ref を release イベントはタグ、手動実行は対象ブランチ (通常 main) に切り替え - publish ステップの prerelease 判定は手動実行時スキップされないよう修正 - バージョンは package.json から取得するため version sync ステップを削除 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tomoemon
force-pushed
the
ci/release-workflow-dispatch
branch
from
May 17, 2026 01:35
0dd75dc to
be6df11
Compare
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
release.yamlにworkflow_dispatchを追加し、npm publish を手動実行できるようにするpackage.jsonから取得するため、実行時の入力は不要workflow_dispatch実行時に publish ステップがスキップされないよう prerelease 判定を修正設計の背景
release-tag.yamlはGITHUB_TOKENを使って GitHub release を作成しているが、GitHub の仕様によりGITHUB_TOKENが起こしたイベントは他の workflow をトリガーしない。そのためrelease.yaml(on: release: types: [published])が起動せず、npm publish が走らなかった(v0.4.1 が npm 未公開のまま)。恒久対応として
workflow_dispatchを追加し、自動チェーンが切れた場合でも手動で publish できる経路を用意する。変更点の詳細:
checkoutのrefを、release イベントはタグ (github.event.release.tag_name)、手動実行は対象ブランチ (github.ref、通常 main) に切り替えpackage.jsonから取得する。release-tag が package.json の変更を起点にタグを作るため、タグ側の package.json は常にそのバージョンになっており、入力やタグ指定は不要Sync package.json version with release tagステップを削除github.event_name == 'workflow_dispatch' || github.event.release.prerelease == falseに変更(手動実行時はgithub.event.releaseが存在せず判定が false になり publish がスキップされてしまうため)検討した代替案
workflow_dispatchにタグ入力を設ける案: 当初はタグ文字列を入力させる実装だったが、type: choiceの選択肢は静的にしか定義できず release tag を動的に一覧化できない。自由入力は打ち間違いの余地がある。最新 main のpackage.jsonの version をそのまま使えば入力自体が不要になるため、入力を撤廃したrelease-tag.yamlのgh release createを PAT に切り替える案: 自動チェーンは復活するが、PAT の発行・secret 管理・更新の運用コストがかかるため見送りrelease-tag.yaml内で publish まで行う案: workflow の責務(タグ作成 / 公開)が混ざるため見送りTest plan
releaseworkflow をworkflow_dispatch(main ブランチ)で実行し、npm に 0.4.1 が publish されることを確認🤖 Generated with Claude Code