Commit a7d3312
authored
feat: add webhook handler for worlddriven-migrate app (#329)
Implement the backend support for a separate GitHub App that handles
repository transfers to the worlddriven organization.
Changes:
- Add /api/webhooks/migrate endpoint for the migrate app
- Add migrationHandler.js with transfer logic:
- findApprovedMigrationPR: checks for approved PRs in documentation repo
- transferRepository: calls GitHub transfer API
- triggerPRChecks: re-runs CI after successful transfer
- Add getInstallationAccessToken to githubApp.js for multi-app support
- Update .env-example with migrate app credentials
The migrate app uses a separate minimal permission set (administration
only) to enable transfers without requiring elevated permissions on
the main worlddriven app.
Flow:
1. User installs worlddriven-migrate app on their repo
2. Webhook triggers, checks for approved migration PR
3. If approved, transfers repo to worlddriven org
4. Comments on PR and triggers CI re-run
Relates to worlddriven/documentation#231 parent a36e795 commit a7d3312
4 files changed
Lines changed: 522 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
25 | 52 | | |
26 | 53 | | |
27 | 54 | | |
| |||
0 commit comments