Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
b0aa73b4
Commit
b0aa73b4
authored
Nov 30, 2022
by
Balázs Orbán
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: disable auto-labeling
parent
7bd17038
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
33 deletions
+39
-33
index.mjs
.github/actions/issue-validator/index.mjs
+1
-1
index.mjs
.github/actions/issue-validator/src/index.mjs
+38
-32
No files found.
.github/actions/issue-validator/index.mjs
View file @
b0aa73b4
This diff is collapsed.
Click to expand it.
.github/actions/issue-validator/src/index.mjs
View file @
b0aa73b4
...
@@ -8,7 +8,7 @@ import { join } from 'node:path'
...
@@ -8,7 +8,7 @@ import { join } from 'node:path'
const
verifyCanaryLabel
=
'please verify canary'
const
verifyCanaryLabel
=
'please verify canary'
const
addReproductionLabel
=
'please add a complete reproduction'
const
addReproductionLabel
=
'please add a complete reproduction'
const
bugLabel
=
'template: bug'
//
const bugLabel = 'template: bug'
const
__dirname
=
const
__dirname
=
'/home/runner/work/next.js/next.js/.github/actions/issue-validator'
'/home/runner/work/next.js/next.js/.github/actions/issue-validator'
...
@@ -48,11 +48,11 @@ async function run() {
...
@@ -48,11 +48,11 @@ async function run() {
if
(
pull_request
||
!
issue
?.
body
||
!
process
.
env
.
GITHUB_TOKEN
)
return
if
(
pull_request
||
!
issue
?.
body
||
!
process
.
env
.
GITHUB_TOKEN
)
return
const
labels
=
issue
.
labels
.
map
((
l
)
=>
l
.
name
)
const
labels
=
issue
.
labels
.
map
((
l
)
=>
l
.
name
)
const
isBugReport
=
//
const isBugReport =
labels
.
includes
(
bugLabel
)
||
newLabel
===
bugLabel
||
!
labels
.
length
//
labels.includes(bugLabel) || newLabel === bugLabel || !labels.length
if
(
if
(
!
(
isBugReport
&&
issue
.
number
>
43554
)
&&
//
!(isBugReport && issue.number > 43554) &&
!
[
verifyCanaryLabel
,
addReproductionLabel
].
includes
(
newLabel
)
&&
!
[
verifyCanaryLabel
,
addReproductionLabel
].
includes
(
newLabel
)
&&
!
(
!
(
labels
.
includes
(
verifyCanaryLabel
)
||
labels
.
includes
(
verifyCanaryLabel
)
||
...
@@ -64,33 +64,36 @@ async function run() {
...
@@ -64,33 +64,36 @@ async function run() {
)
)
}
}
/** @param {string|null|undefined} link */
/
/ /
** @param {string|null|undefined} link */
async
function
hasRepro
(
link
)
{
//
async function hasRepro(link) {
if
(
!
link
)
return
false
//
if (!link) return false
try
{
//
try {
const
url
=
new
URL
(
link
)
//
const url = new URL(link)
if
([
'example.com'
].
includes
(
url
.
hostname
))
{
//
if (['example.com'].includes(url.hostname)) {
return
false
//
return false
}
//
}
}
catch
{
//
} catch {
return
false
//
return false
}
//
}
const
response
=
await
fetch
(
link
)
//
const response = await fetch(link)
return
response
.
ok
//
return response.ok
}
//
}
const
hasValidRepro
=
//
const hasValidRepro =
isBugReport
&&
//
isBugReport &&
(
await
hasRepro
(
//
(await hasRepro(
issue
.
body
.
match
(
//
issue.body.match(
/will be addressed faster
\n\n(
.*
)\n\n
### To Reproduce/i
//
/will be addressed faster\n\n(.*)\n\n### To Reproduce/i
)?.[
1
]
//
)?.[1]
))
//
))
const
client
=
github
.
getOctokit
(
process
.
env
.
GITHUB_TOKEN
).
rest
const
client
=
github
.
getOctokit
(
process
.
env
.
GITHUB_TOKEN
).
rest
const
issueCommon
=
{
...
repo
,
issue_number
:
issue
.
number
}
const
issueCommon
=
{
...
repo
,
issue_number
:
issue
.
number
}
if
(
newLabel
===
addReproductionLabel
||
!
hasValidRepro
)
{
if
(
newLabel
===
addReproductionLabel
// || !hasValidRepro
)
{
await
Promise
.
all
([
await
Promise
.
all
([
client
.
issues
.
addLabels
({
client
.
issues
.
addLabels
({
...
issueCommon
,
...
issueCommon
,
...
@@ -106,13 +109,16 @@ async function run() {
...
@@ -106,13 +109,16 @@ async function run() {
)
)
}
}
const
isVerifyCanaryChecked
=
//
const isVerifyCanaryChecked =
isBugReport
&&
//
isBugReport &&
issue
.
body
.
match
(
//
issue.body.match(
/-
\[
x
\]
I verified that the issue exists in the latest Next.js canary release/i
//
/- \[x\] I verified that the issue exists in the latest Next.js canary release/i
)
//
)
if
(
newLabel
===
verifyCanaryLabel
||
!
isVerifyCanaryChecked
)
{
if
(
newLabel
===
verifyCanaryLabel
// || !isVerifyCanaryChecked
)
{
await
Promise
.
all
([
await
Promise
.
all
([
client
.
issues
.
addLabels
({
client
.
issues
.
addLabels
({
...
issueCommon
,
...
issueCommon
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment