Skip to content

Commit

Permalink
🤖 lazy commit
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Sep 14, 2023
1 parent 2920859 commit bc9ab8d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Nissuer
uses: balazsorban44/[email protected].6
uses: balazsorban44/[email protected].7
with:
reproducition-comment: ".github/invalid-reproduction.md"
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ import { join } from "node:path"
const config = {
invalidLink: {
comment: getInput("reproduction-comment"),
hosts: getInput("reproduction-hosts")
hosts: (getInput("reproduction-hosts") ?? "github.com")
.split(",")
.map((h) => h.trim()),
label: getInput("reproduction-invalid-label"),
linkSection: getInput("reproduction-link-section"),
label: getInput("reproduction-invalid-label") ?? "invalid reproduction",
linkSection:
getInput("reproduction-link-section") ??
"### Link to reproduction(.*)### To reproduce",
},
}

Expand Down Expand Up @@ -73,7 +75,7 @@ run().catch(setFailed)
*/
async function isValidReproduction(body) {
const linkSectionRe = new RegExp(config.invalidLink.linkSection, "is")
const link = body.match(linkSectionRe)?.[1].trim()
const link = body.match(linkSectionRe)?.[1]?.trim()
if (!link) return info("Missing link")

if (!URL.canParse(link)) return info(`Invalid URL: ${link}`)
Expand Down

0 comments on commit bc9ab8d

Please sign in to comment.