Use workflow_dispatch to re-trigger CI instead of closing/reopening PR (#2382)
## Summary
Replace the PR close/reopen mechanism for CI re-triggering with GitHub's
`workflow_dispatch` event, which is more reliable and avoids potential
issues with PR state management.
## Key Changes
- **ci.yml**: Added `workflow_dispatch` trigger with optional
`pr_number` input parameter to allow manual CI runs
- **ci.yml**: Updated test check logic to always run tests when
triggered via `workflow_dispatch`
- **ci.yml**: Pass `PR_NUMBER` environment variable to Playwright
summary script for workflow_dispatch triggers
- **pr-review-responder.yml**: Replaced PR close/reopen logic with `gh
workflow run` command to trigger CI via `workflow_dispatch`
## Implementation Details
- The `workflow_dispatch` trigger accepts an optional `pr_number` input
that can be passed by the pr-review-responder workflow
- When CI is triggered via `workflow_dispatch`, tests always run
(skipping the file change check)
- The new approach is more reliable because:
- Avoids the risk of leaving a PR in a closed state if operations fail
- Works with `GITHUB_TOKEN` without infinite loop concerns
- Provides explicit control over when CI re-runs
- Eliminates retry logic and recovery mechanisms needed with
close/reopen approach
https://claude.ai/code/session_014TKdhebC3RqZ7yusKuRSJD
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2382">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open with Devin">
</picture>
</a>
<!-- devin-review-badge-end -->
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Medium risk because it changes GitHub Actions triggering, concurrency
grouping, and checkout behavior (including fork PR handling) for CI and
AI review bots; misconfiguration could lead to running workflows on the
wrong ref or not running at all.
>
> **Overview**
> Switches CI and AI-bot workflows to support manual `workflow_dispatch`
runs via a required `pr_number`, enabling reliable re-triggers without
PR close/reopen.
>
> `ci.yml` now derives checkout `repository`/`ref` from the PR head
(fetched via `gh pr view` for dispatch), updates concurrency grouping to
key by PR number, always runs tests for dispatch runs, and passes
`PR_NUMBER` to the Playwright summary script so comments still attach to
the correct PR.
>
> `pr-review-responder.yml` replaces the close/reopen hack with `gh
workflow run` calls to dispatch `ci.yml`, `bugbot-trigger.yml`, and
`claude-pr-review.yml` when Claude pushes commits. `bugbot-trigger.yml`
and `claude-pr-review.yml` add dispatch support and PR-number fallbacks;
BugBot additionally validates `pr_number` and re-checks skip tags before
commenting.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
357dddba6b3c3c9144b21f6f400fc0b49e55e244. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Switch re-triggers to workflow_dispatch for CI, BugBot, and Claude PR
Review. This replaces the close/reopen hack, works with GITHUB_TOKEN,
and ensures tests and reviews run after automated commits.
- **Refactors**
- Added workflow_dispatch with pr_number input to ci.yml,
bugbot-trigger.yml, and claude-pr-review.yml.
- pr-review-responder now calls gh workflow run for all three when it
pushes commits.
- CI always runs tests on workflow_dispatch, checks out the PR head
(supports forks), passes PR_NUMBER to the Playwright summary, and uses
pr_number in concurrency.
- Claude PR Review fetches PR head info on dispatch; concurrency keys
use pr_number when provided.
- BugBot dispatch uses inputs.pr_number, re-checks skip tags, and
bypasses author gating for dispatch.
<sup>Written for commit 357dddba6b3c3c9144b21f6f400fc0b49e55e244.
Summary will update on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by:
Claude <noreply@anthropic.com>
正在显示
请
注册
或者
登录
后发表评论