fix(ci): リリースワークフローにバージョンアップコミット・タグのpush処理を追加#968
Merged
Conversation
問題の背景: - catkin_prepare_release は --no-push オプションで実行され、 バージョンアップコミットとタグがローカルのみで作成されていた - softprops/action-gh-release がタグを自動作成する際、 バージョンアップ前のコミットにタグを作成してしまう - 結果として、タグは存在するが package.xml のバージョンが 更新されていない不整合な状態が発生 実施した対策: 1. "Create and push tag" ステップを追加 - バージョンアップコミット作成後、タグをローカルで作成 2. "Push version bump commit and tag" ステップを追加 - バージョンアップコミットを develop ブランチに push - タグをリモートリポジトリに push 3. これにより softprops/action-gh-release は既存のタグを使用し、 正しいコミット(バージョンアップ済み)を指すようになる 効果: - バージョンアップコミットが develop ブランチに反映される - タグが正しいバージョンの package.xml を含むコミットを指す - GitHub Release が正しいバージョン情報を持つ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
テスト用にドライランモードを実装しました。 追加機能: 1. workflow_dispatch に dry_run パラメータを追加 - ドライランモード(実際のpush・リリースは行わない) - デフォルト: false 2. ドライランモード時の動作 - ワークフロー開始時にドライランモードであることを明示 - タグ削除: 実行せず、実行予定のコマンドを表示 - コミット・タグのpush: 実行せず、実行予定のコマンドを表示 - GitHub Release作成: スキップ 3. ログ出力の改善 - 通常モード: ✅ マーク付きで実行結果を表示 - ドライランモード: 🔍 マーク付きで実行予定を表示 効果: - リモートリポジトリに影響を与えずにワークフローをテスト可能 - ログで実行される予定のコマンドを確認可能 - 安全なワークフロー開発・デバッグが可能 使用方法: Actions タブから「Auto Version Bump and Release」ワークフローを 手動実行し、dry_run オプションを true に設定 🤖 Generated with [Claude Code](https://claude.com/claude-code)
問題: ドライランモードでタグ作成時にエラーが発生: ``` fatal: tag '1.0.1' already exists ``` 原因: 1. catkin_prepare_release --no-push がタグを作成 2. Amend commit でコミットを修正(git reset --soft HEAD~1) → この時点でタグは古いコミット(削除済み)を指している 3. Create and push tag ステップで再度タグ作成を試みてエラー 修正内容: 1. "Create and push tag" ステップを削除 2. "Amend commit with custom message" ステップ内でタグを再作成 - catkin_prepare_releaseが作成したタグを削除 - 新しいコミット(修正後)にタグを再作成 処理フロー(修正後): 1. catkin_prepare_release → コミットA + タグ作成 2. Amend commit → コミットAを削除、コミットBを作成 3. タグ削除 → タグを削除 4. タグ再作成 → コミットBにタグを作成 5. Push → コミットBとタグをpush これにより、タグが正しく新しいコミットを指すようになります。 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Contributor
Contributor
Contributor
This was referenced Nov 8, 2025
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.
概要
リリースワークフローで、バージョンアップコミットとタグが正しくリモートリポジトリにpushされるように修正しました。
問題の詳細
発生していた問題
前回のPR (#967) マージ後、以下の問題が発生していました:
根本原因
結果: バージョンアップコミットはローカルのみに存在し、リモートには反映されず、タグは古いコミットを指してしまう。
実施した修正
1. 即時対応(完了済み)
2. ワークフロー修正(本PR)
追加した2つのステップ:
① Create and push tag
タグをローカルで作成
② Push version bump commit and tag
バージョンアップコミットとタグをリモートにpush
追加位置: 「Amend commit with custom message」ステップの後
修正後の処理フロー
効果
✅ バージョンアップコミットが develop ブランチに正しく反映される
✅ タグが正しいバージョンの package.xml を含むコミットを指す
✅ GitHub Release が正しいバージョン情報を持つ
✅ 次回以降のリリースも正しく動作する
テスト計画
関連PR
🤖 Generated with Claude Code