ci: dispatch PR lifecycle events to a downstream repo#3926
Conversation
Mirrors the main-image dispatch in publish.yml: on pull request state changes (opened, closed, reopened, ready for review, converted to draft, title edits) and pushes to main, send a repository_dispatch so downstream consumers can react to PR lifecycle events without polling. Same-repo events only; the target repo is configurable via repository variables.
|
WalkthroughThis pull request adds a new GitHub Actions workflow file ( 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/pr-events.yml (1)
21-25: 💤 Low valueConsider renaming
PR_EVENTS_DISPATCH_REPOfor clarity.The variable name
PR_EVENTS_DISPATCH_REPOsuggests it might be the dispatch target, but it's actually validating the source repository where the workflow should run. This contrasts withPR_EVENTS_DISPATCH_TARGET(line 48) which is the actual destination. A maintainer could mistakenly configure this variable thinking it controls where events are sent.Consider renaming to something like
PR_EVENTS_SOURCE_REPOor adding a comment clarifying its purpose.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: cde4a033-2e55-494d-a8ce-fab0464ca9eb
📒 Files selected for processing (1)
.github/workflows/pr-events.yml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
.github/workflows/pr-events.yml (4)
1-7: LGTM!
8-12: LGTM!
27-42: LGTM!
44-50: LGTM!
Summary
Adds a small workflow that sends a
repository_dispatch(oss-pr-event) when a pull request changes state (opened, closed, reopened, ready for review, converted to draft, title edited) or when main receives a push. This lets downstream consumers react to PR lifecycle events without polling the API.Mirrors the existing main-image dispatch in publish.yml (#3875, #3883): same pinned action and token, target repo configurable via repository variables. Same-repo PR events only, since fork contexts carry no secrets; fork merges still reach downstream through the push trigger.