Skip to content

canary 向けバージョン bump ワークフローを workflow_dispatch で手動実行できるようにする#5867

Merged
TinyKitten merged 4 commits intodevfrom
feature/canary-bump-workflow-dispatch
Apr 25, 2026
Merged

canary 向けバージョン bump ワークフローを workflow_dispatch で手動実行できるようにする#5867
TinyKitten merged 4 commits intodevfrom
feature/canary-bump-workflow-dispatch

Conversation

@TinyKitten
Copy link
Copy Markdown
Member

@TinyKitten TinyKitten commented Apr 25, 2026

概要

canary 向けバージョン bump ワークフロー (bump_version_on_canary_pr.yml) に workflow_dispatch トリガーを追加し、GitHub Actions の UI から手動で実行できるようにする。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • .github/workflows/bump_version_on_canary_pr.ymlon:workflow_dispatch: を追加。canary 向け PR が opened された時の自動実行に加えて、Actions タブから任意のタイミングで手動実行できる。

テスト

  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

関連Issue

スクリーンショット(任意)

Summary by CodeRabbit

リリースノート

  • メンテナンス
    • バージョン管理ワークフローが手動実行に対応しました。canary ブランチへのプルリクエストに加え、手動トリガーでも実行可能です。
    • 手動実行時にプルリクエスト番号やヘッドブランチを入力でき、実行時に適切な PR 情報を参照して処理されます。

@TinyKitten TinyKitten self-assigned this Apr 25, 2026
@github-actions github-actions Bot added the ci/cd label Apr 25, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 25, 2026

Caution

Review failed

The head commit changed during the review from 114fcee to fabf242.

📝 Walkthrough

Walkthrough

workflow_dispatch を追加し、手動実行に対応。ジョブの条件とチェックアウト/PRメタデータ参照を、プルリクエストイベントのコンテキストが存在する場合はそれを使い、無い場合は inputs.head_ref / inputs.pr_number にフォールバックするよう変更。

Changes

Cohort / File(s) Summary
GitHub Actions ワークフロー
\.github/workflows/bump_version_on_canary_pr.yml
workflow_dispatch トリガー追加。bump-version ジョブの実行条件を、pull_request (target: canary, ラベルに skip-version-bump がない場合) または手動ディスパッチに拡張。チェックアウトやPR関連参照をイベントコンテキストまたは inputs.head_ref / inputs.pr_number にフォールバックするよう更新。

Sequence Diagram(s)

sequenceDiagram
  participant User as 手動トリガー
  participant GitHub as GitHub Actions
  participant Repo as リポジトリ / PR

  User->>GitHub: workflow_dispatch (inputs.pr_number, inputs.head_ref)
  GitHub->>Repo: checkout (use inputs if PR context absent)
  GitHub->>Repo: determine PR metadata (use pr context or inputs)
  GitHub->>Repo: create/update PR on generated branch
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

ぴょんと跳ねてボタン押すよ🐰
ワークフローが手を振るよ✨
Canary の道も開けて、
小さな枝で世界広がる。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR タイトルは GitHub Actions ワークフローに workflow_dispatch トリガーを追加する主要な変更を正確に反映しており、簡潔で明確である。
Description check ✅ Passed PR説明はテンプレートの必須セクションを完全に埋めており、変更内容が詳細に記述され、テスト実施も明記されている。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/canary-bump-workflow-dispatch

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/bump_version_on_canary_pr.yml:
- Line 8: Add required workflow_dispatch inputs and make every use of
github.event.pull_request.* resilient by falling back to those inputs when the
event is a manual dispatch: define inputs such as pr_number, head_ref, base_ref,
head_sha, and sender_login under workflow_dispatch, then update each reference
(all occurrences of github.event.pull_request.number, .head.ref, .base.ref,
.head.sha, .user.login, etc.) to use a conditional/fallback expression that
prefers github.event.pull_request.* but falls back to the corresponding input
(e.g., use an expression that returns github.event.pull_request.number when
present else inputs.pr_number), ensuring all places that currently read
github.event.pull_request.* will work for both pull_request events and manual
workflow_dispatch runs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c79ebdc6-28c3-42ec-9a4b-3328e70d51cf

📥 Commits

Reviewing files that changed from the base of the PR and between b56bcf4 and c0bfa39.

📒 Files selected for processing (1)
  • .github/workflows/bump_version_on_canary_pr.yml

Comment thread .github/workflows/bump_version_on_canary_pr.yml
…フォールバックを設定して手動実行でもジョブが完走するようにする
@TinyKitten
Copy link
Copy Markdown
Member Author

Fixes Applied Successfully

Fixed 1 file based on 1 unresolved CodeRabbit review comment.

Files modified:

  • .github/workflows/bump_version_on_canary_pr.yml

Commit: d6d8ae857

The latest autofix changes are on the feature/canary-bump-workflow-dispatch branch.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/bump_version_on_canary_pr.yml (1)

30-34: 条件式内の文字列クォートをダブルクォートに統一してください。

機能影響はありませんが、このリポジトリのYAML運用ルールに合わせて統一した方が保守しやすいです。

差分案
       (
-        github.event_name == 'pull_request' &&
+        github.event_name == "pull_request" &&
         github.event.pull_request.head.repo.full_name == github.repository &&
-        !contains(github.event.pull_request.labels.*.name, 'skip-version-bump')
-      ) || github.event_name == 'workflow_dispatch'
+        !contains(github.event.pull_request.labels.*.name, "skip-version-bump")
+      ) || github.event_name == "workflow_dispatch"

Based on learnings: In YAML workflow files under .github/workflows, enforce double-quote usage for strings (e.g., actions inputs, env values).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/bump_version_on_canary_pr.yml around lines 30 - 34, The
conditional expression uses single-quoted strings; update them to double-quoted
strings so the condition normalizes with the repo's YAML rule: change
'pull_request', 'skip-version-bump', and 'workflow_dispatch' to use double
quotes in the condition that references github.event_name,
github.event.pull_request.head.repo.full_name == github.repository, and
contains(github.event.pull_request.labels.*.name, ...).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/bump_version_on_canary_pr.yml:
- Around line 30-34: The conditional expression uses single-quoted strings;
update them to double-quoted strings so the condition normalizes with the repo's
YAML rule: change 'pull_request', 'skip-version-bump', and 'workflow_dispatch'
to use double quotes in the condition that references github.event_name,
github.event.pull_request.head.repo.full_name == github.repository, and
contains(github.event.pull_request.labels.*.name, ...).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9ca7f0e-3948-413c-aa6b-e0e4bd5ead85

📥 Commits

Reviewing files that changed from the base of the PR and between c0bfa39 and d6d8ae8.

📒 Files selected for processing (1)
  • .github/workflows/bump_version_on_canary_pr.yml

@TinyKitten
Copy link
Copy Markdown
Member Author

Nitpick fix reverted

114fcee92 で適用したダブルクォート化を fabf24229 で revert しました。

理由: GitHub Actions の式言語(${{ }}if: 内)の文字列リテラルは シングルクォートのみ が有効で、ダブルクォートを使うと Unexpected symbol で構文エラーになります(IDE の Actions 構文チェックでも検出されました)。

CodeRabbit の learning「.github/workflows 配下では文字列はダブルクォート」は YAML スカラー値(actions の input 値や env 値など)に対するルールで、Actions 式言語には適用できません。今回の指摘箇所は対象外と判断します。

The latest changes are on the feature/canary-bump-workflow-dispatch branch.

@TinyKitten
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 25, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@TinyKitten TinyKitten merged commit 9e5a30d into dev Apr 25, 2026
4 checks passed
@TinyKitten TinyKitten deleted the feature/canary-bump-workflow-dispatch branch April 25, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant