Skip to content

ci: fix PR number resolution in comment workflows#1408

Merged
TinyKitten merged 1 commit intodevfrom
claude/add-pr-validation-comments-OWqjc
Mar 5, 2026
Merged

ci: fix PR number resolution in comment workflows#1408
TinyKitten merged 1 commit intodevfrom
claude/add-pr-validation-comments-OWqjc

Conversation

@TinyKitten
Copy link
Member

@TinyKitten TinyKitten commented Mar 5, 2026

Summary

  • Comment workflow で github.event.workflow_run.pull_requests[0].number が空の場合にアーティファクトの pr_number にフォールバックするよう修正
  • PR 近鉄種別修正 #1405 で head/base ブランチが同名のため pull_requests 配列が空になり、コメント投稿が失敗していた問題を解消
  • 全ダウンストリームステップを steps.meta.outputs.pr_number に統一

Test plan

  • PR 近鉄種別修正 #1405 のように head/base が同名の PR で comment workflow が正しく動作することを確認
  • 通常の PR でもイベントコンテキストからPR番号が取得され正常にコメントが投稿されることを確認

https://claude.ai/code/session_01Lr3k5y8UYcH26a8hndo8ek

Summary by CodeRabbit

リリースノート

  • Bug Fixes
    • プルリクエスト番号の取得ロジックを強化し、複数のフォールバック機構を追加しました。これにより、ワークフロー処理の信頼性が向上し、エラーハンドリングが改善されました。

github.event.workflow_run.pull_requests[0].number can be empty when
GitHub cannot resolve the PR association (e.g., head and base branch
share the same name). This caused the comment step to fail on PR #1405.

Use event context when available, fall back to artifact pr_number file.
All downstream steps reference steps.meta.outputs.pr_number.

https://claude.ai/code/session_01Lr3k5y8UYcH26a8hndo8ek
@github-actions github-actions bot added the ci/cd label Mar 5, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c9a8f3d2-bedd-4866-bce5-0b0b29e4653e

📥 Commits

Reviewing files that changed from the base of the PR and between 64b2b23 and dd93cd6.

📒 Files selected for processing (2)
  • .github/workflows/verify_data_integrity_comment.yml
  • .github/workflows/visualize_stopping_patterns_comment.yml

📝 Walkthrough

ウォークスルー

2つのGitHub Actionsワークフローファイルを更新し、PRの番号取得ロジックを強化。ワークフロー実行コンテキストから番号を取得し、失敗時は保存されたアーティファクトにフォールバック。その後、各ステップが出力された番号を参照するように変更。

変更

コホート / ファイル 概要
ワークフロー PR番号処理の強化
.github/workflows/verify_data_integrity_comment.yml, .github/workflows/visualize_stopping_patterns_comment.yml
メタデータ読み込みステップで堅牢なPR番号取得を導入。github.event.workflow_run.pull_requests[0].numberから取得を試み、失敗時は /tmp/*/pr_number にフォールバック。警告を発行し、番号が決定できない場合はエラー終了。後続のステップで steps.meta.outputs.pr_number を使用するよう更新。

コード レビュー工数の見積もり

🎯 2 (Simple) | ⏱️ ~8 minutes

関連する可能性のあるプルリクエスト

推奨ラベル

ci/cd

ポエム

🐰 PR番号をかしこく取得して、
ワークフロー強く進むなり
フォールバックで落ちることなく
アーティファクトに頼りて
コメント投稿よろこべり!✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR タイトルは、ワークフローのコメント機能における PR 番号の解決問題を修正することが、変更内容の主要な目的であり、このタイトルは変更内容と完全に関連しており、修正の目的を明確に要約しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/add-pr-validation-comments-OWqjc

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

@TinyKitten TinyKitten self-assigned this Mar 5, 2026
@TinyKitten TinyKitten merged commit ce5b4b8 into dev Mar 5, 2026
2 checks passed
@TinyKitten TinyKitten deleted the claude/add-pr-validation-comments-OWqjc branch March 5, 2026 11:22
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.

2 participants