Commit ef7c9a40 authored by Balázs Orbán's avatar Balázs Orbán

chore: improve issue validator logs

parent 8a2bb49d
......@@ -8708,11 +8708,14 @@
} = e.context
if (d || !p?.body) return
const { body: n, labels: l, number: m } = p
a.info(
`Validating issue ${m}:\n Label(s): ${l.join(', ')}\n Body: ${n}`
)
const u = l.some((e) => e.name === r)
const c = l.some((e) => e.name === t)
if (!u || !c) {
return a.info(
`issue ${m} is ignored, because it is not a bug report or is not manually labeled`
'Issue is ignored, because it is not a bug report or is not manually labeled'
)
}
if (!process.env.GITHUB_TOKEN) {
......@@ -8740,7 +8743,7 @@
'Please verify your issue reproduces with `next@canary`. The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running `npm install next@canary`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.'
)
return a.info(
`Commented on issue ${m}, because it was ${
`Commented on issue, because it was ${
c ? 'manually labeled' : 'not verified against canary'
}`
)
......@@ -8754,7 +8757,7 @@
'The link to the reproduction appears to be incorrect/unreachable. Please add a link to the reproduction of the issue. This is a required field. If your project is private, you can invite @balazsorban44 to the repository so the Next.js team can investigate further.'
)
return a.info(
`Commented on issue ${m}, because it the reproduction url (${g}) was not reachable.`
`Commented on issue, because the reproduction url (${g}) was not reachable`
)
}
const w = [
......@@ -8782,7 +8785,7 @@
`The reported Next.js version did not match the latest \`next@canary\` version (${T}). The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running \`npm install next@canary\`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.`
)
return a.info(
`Commented on issue ${m}, because it was not verified against canary.`
`Commented on issue, because it was not verified against canary`
)
}
} catch (e) {
......
......@@ -18,6 +18,12 @@ async function run() {
const { body, labels, number: issueNumber } = issue
core.info(
`Validating issue ${issueNumber}:
Label(s): ${labels.join(', ')}
Body: ${body}`
)
const isBugReport = labels.some((label) => label.name === bugReportLabel)
const isManuallyLabeled = labels.some(
......@@ -26,7 +32,7 @@ async function run() {
if (!isBugReport || !isManuallyLabeled) {
return core.info(
`issue ${issueNumber} is ignored, because it is not a bug report or is not manually labeled`
'Issue is ignored, because it is not a bug report or is not manually labeled'
)
}
......@@ -65,7 +71,7 @@ async function run() {
'Please verify your issue reproduces with `next@canary`. The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running `npm install next@canary`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.'
)
return core.info(
`Commented on issue ${issueNumber}, because it was ${
`Commented on issue, because it was ${
isManuallyLabeled ? 'manually labeled' : 'not verified against canary'
}`
)
......@@ -81,7 +87,7 @@ async function run() {
'The link to the reproduction appears to be incorrect/unreachable. Please add a link to the reproduction of the issue. This is a required field. If your project is private, you can invite @balazsorban44 to the repository so the Next.js team can investigate further.'
)
return core.info(
`Commented on issue ${issueNumber}, because it the reproduction url (${reproductionUrl}) was not reachable.`
`Commented on issue, because the reproduction url (${reproductionUrl}) was not reachable`
)
}
......@@ -120,7 +126,7 @@ async function run() {
`The reported Next.js version did not match the latest \`next@canary\` version (${lastVersion}). The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. Think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running \`npm install next@canary\`. If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.`
)
return core.info(
`Commented on issue ${issueNumber}, because it was not verified against canary.`
`Commented on issue, because it was not verified against canary`
)
}
} catch (error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment