Skip to content

Commit

Permalink
chore(release-tooling): Fix PR count message
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Jan 1, 2024
1 parent d326b07 commit c7ae669
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tasks/release/release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ async function resolveMilestones() {
{
search(
query: "repo:redwoodjs/redwood is:pr is:merged milestone:next-release-patch"
first: 5
first: 51
type: ISSUE
) {
nodes {
Expand All @@ -222,12 +222,14 @@ async function resolveMilestones() {
`)

if (semver === 'patch') {
const prettyPatch = chalk.magenta('next-release-patch')
const singularMsg = `There's 1 PR that has the ${prettyPatch} milestone.`
const pluralMsg =
prs.length <= 50
? `There are ${prs.length} PRs that have the ${prettyPatch} milestone.`
: `There are more than 50 PRs that have the ${prettyPatch} milestone.`
console.log()
console.log(
`There's ${prs.length} PR(s) that have the ${chalk.magenta(
'next-release-patch'
)} milestone.`
)
console.log(prs.length === 1 ? singularMsg : pluralMsg)

if (
!isYes(
Expand Down

0 comments on commit c7ae669

Please sign in to comment.