GeezerVison is showing github.com — ci: add --label beta filter to only process PRs with beta label · simonklee/opencode@4158d7c
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: script/beta.ts +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,6 +7,7 @@ interface PR { |
7 | 7 | number: number |
8 | 8 | title: string |
9 | 9 | author: { login: string } |
| 10 | + labels: Array<{ name: string }> |
10 | 11 | } |
11 | 12 |
|
12 | 13 | interface FailedPR { |
@@ -31,12 +32,13 @@ Please resolve this issue to include this PR in the next beta release.` |
31 | 32 | } |
32 | 33 |
|
33 | 34 | async function main() { |
34 | | - console.log("Fetching open PRs from team members...") |
| 35 | + console.log("Fetching open PRs with beta label from team members...") |
35 | 36 |
|
36 | 37 | const allPrs: PR[] = [] |
37 | 38 | for (const member of Script.team) { |
38 | 39 | try { |
39 | | - const stdout = await $`gh pr list --state open --author ${member} --json number,title,author --limit 100`.text() |
| 40 | + const stdout = |
| 41 | + await $`gh pr list --state open --author ${member} --label beta --json number,title,author,labels --limit 100`.text() |
40 | 42 | const memberPrs: PR[] = JSON.parse(stdout) |
41 | 43 | allPrs.push(...memberPrs) |
42 | 44 | } catch { |
@@ -51,7 +53,7 @@ async function main() { |
51 | 53 | return true |
52 | 54 | }) |
53 | 55 |
|
54 | | - console.log(`Found ${prs.length} open PRs from team members`) |
| 56 | + console.log(`Found ${prs.length} open PRs with beta label from team members`) |
55 | 57 |
|
56 | 58 | if (prs.length === 0) { |
57 | 59 | console.log("No team PRs to merge") |
|