Skip to content

Commit

Permalink
fix: correctly handle issue with no label
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Feb 12, 2024
1 parent af6911b commit 578a391
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Nissuer
uses: balazsorban44/nissuer@1.9.0
uses: balazsorban44/nissuer@1.9.1
with:
label-area-section: 'Which area\(s\) are affected\?(.*)'
reproduction-issue-labels: "bug,"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Nissuer
uses: balazsorban44/nissuer@1.9.0
uses: balazsorban44/nissuer@1.9.1
```

Add a comment file (by default we look for `.github/invalid-reproduction.md`):
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,14 @@ async function checkValidReproduction() {
/** @type {string[]} */
const labels = issue.labels.map((l) => l.name)

if (
(!labels.length && config.invalidLink.bugLabels.includes("")) ||
(config.invalidLink.bugLabels.length &&
!labels.some((l) => config.invalidLink.bugLabels.includes(l)))
)
const issueWithoutLabel =
config.invalidLink.bugLabels.includes("") && !labels.length

const issueMatchingLabel =
config.invalidLink.bugLabels.length &&
!labels.some((l) => config.invalidLink.bugLabels.includes(l))

if (!issueWithoutLabel || issueMatchingLabel)
return info("Not manually or already labeled")

if (await isValidReproduction(issue.body))
Expand Down

0 comments on commit 578a391

Please sign in to comment.