Add GitHub Actions workflow for auto-merging PRs (#2588)
## Summary
- Adds a new GitHub Actions workflow (`merge-pr.yml`) that automatically
merges PRs when CI passes
- Only merges PRs authored by allowed users (wwwillchen, wwwillchen-bot)
- Requires the "merge-when-ready" label to be present on the PR
- Uses squash merge for a clean commit history
## Test plan
- Verify the workflow file syntax is valid
- Create a test PR with the "merge-when-ready" label and verify it
auto-merges after CI passes
- Verify PRs without the label or from non-allowed authors are not
auto-merged
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2588"
target="_blank">
<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 -->
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Adds a GitHub Actions workflow that auto-merges PRs via squash after CI
succeeds, gated by the "merge-when-ready" label and an allowed author
list. Improves reliability with targeted PR lookup, pagination for
checks, and explicit guards to avoid ambiguous or incomplete states.
- **New Features**
- Adds .github/workflows/merge-pr.yml triggered on CI workflow_run
completion for pull_request events.
- Finds the PR via workflow_run.pull_requests; refuses merge if multiple
PRs are linked; fallback uses commit lookup with head_branch match and
refuses merge if multiple open PRs; confirms the PR is open.
- Validates all check suites with pagination; skips
neutral/skipped/cancelled, the workflow’s own suite, and
workflow_run-triggered suites; requires at least one successful suite;
uses sha in merge to prevent race conditions; parses allowed authors
from env robustly.
<sup>Written for commit a007deffa6b3c8807833dcee702fa99179f9fe7e.
Summary will update on new commits.</sup>
<!-- End of auto-generated description by cubic. -->
---------
Co-authored-by:
Will Chen <willchen90@gmail.com>
Co-authored-by:
Claude Opus 4.5 <noreply@anthropic.com>
正在显示
.github/workflows/merge-pr.yml
0 → 100644
请
注册
或者
登录
后发表评论