|
17 | 17 | types: [opened, edited, reopened, synchronize] |
18 | 18 | branches: [staging, main] |
19 | 19 | schedule: |
20 | | - # Refresh open staging/main PRs in case the companion merges AFTER this PR |
21 | | - # was opened (scheduled runs use the workflow from the default branch). |
| 20 | + # Refresh open staging/main PRs in case the companion merges AFTER this PR was |
| 21 | + # opened. CAVEAT: GitHub runs scheduled workflows ONLY from the DEFAULT branch's |
| 22 | + # copy of this file — so this auto-refresh activates once the workflow lands on |
| 23 | + # the default branch (via the normal promotion), not before. The pull_request |
| 24 | + # triggers below always work; re-editing the PR re-runs the check meanwhile. |
22 | 25 | - cron: '*/30 * * * *' |
23 | 26 | workflow_dispatch: {} |
24 | 27 |
|
@@ -104,6 +107,9 @@ jobs: |
104 | 107 | async function clear(prNumber) { |
105 | 108 | const ex = await findSticky(prNumber); |
106 | 109 | if (ex) await github.rest.issues.deleteComment({ owner, repo, comment_id: ex.id }); |
| 110 | + // Drop the label too, so a PR edited to remove all companions doesn't |
| 111 | + // keep a stale has-companion badge. 404 if not present → ignore. |
| 112 | + try { await github.rest.issues.removeLabel({ owner, repo, issue_number: prNumber, name: 'has-companion' }); } catch {} |
107 | 113 | } |
108 | 114 | async function ensureLabel() { |
109 | 115 | try { await github.rest.issues.getLabel({ owner, repo, name: 'has-companion' }); } |
|
0 commit comments