Skip to content

Commit 9bafd77

Browse files
authored
chore: Improved output of pending prs script (#3160)
1 parent a9f325e commit 9bafd77

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/compatibility-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
branch: "compatibility-report/auto-update"
6767
delete-branch: true
6868
base: main
69-
labels: "documentation"
69+
labels: "documentation,dev:repo_maintenance"
7070

7171
docs:
7272
runs-on: ubuntu-latest

bin/pending-prs.js

100644100755
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env node
12
/*
23
* Copyright 2021 New Relic Corporation. All rights reserved.
34
* SPDX-License-Identifier: Apache-2.0
@@ -46,8 +47,8 @@ function unreleasedPRs() {
4647
stopOnError()
4748
}
4849

49-
const repos = opts.repos.split(',')
50-
const ignoredLabels = opts.ignoreLabels.split(',')
50+
const repos = opts.repos?.split(',') ?? []
51+
const ignoredLabels = opts.ignoreLabels?.split(',') ?? []
5152

5253
repos.forEach(async (repo) => {
5354
const { prs, latestRelease } = await findMergedPRs(repo, ignoredLabels)
@@ -141,7 +142,13 @@ async function findMergedPRs(repo, ignoredLabels) {
141142
})
142143

143144
console.log(`Found ${filteredPullRequests.length} PRs not yet released.`)
144-
const prs = filteredPullRequests.map((pr) => pr.html_url)
145+
const prs = filteredPullRequests
146+
.sort((a, b) => {
147+
if (a.number > b.number) return 1
148+
if (a.number < b.number) return -1
149+
return 0
150+
})
151+
.map((pr) => `<${pr.html_url} | (${pr.number}) ${pr.title}>`)
145152
return {
146153
prs,
147154
latestRelease

0 commit comments

Comments
 (0)