Skip to content

Commit

Permalink
Update pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
itstrueitstrueitsrealitsreal authored Jul 27, 2024
1 parent 03cc085 commit a39ba95
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ jobs:
repo: context.repo.repo,
pull_number: context.issue.number
})
const isIssueOpen = pr.data.state === 'open';
const isIssueOpen = pr.data.state.description === 'open';
const isTitleValid = /^\[#\d+\] /.test(pr.data.title)
const isDescriptionValid = /([Ff]ix(es|ed)?|[Cc]lose(s|d)?|[Rr]esolve(s|d)?|[Pp]art [Oo]f) #\d+/.test(pr.data.body)
console.log("Issue state:", pr.data.state);
if (isTitleValid && isDescriptionValid && isIssueOpen) {
return
}
Expand All @@ -37,7 +36,7 @@ jobs:
body += "- Description must reference the issue number the PR is fixing, e.g. `Fixes #<issue-number>` (or `Part of #<issue-number>` if the PR does not address the issue fully)\n"
}
if (!isIssueOpen) {
body += "- The issue this PR is addressing is not open. Current state: '" + pr.data.state + "'\n"
body += "- The issue this PR is addressing is not open.\n"
}
body += "\nPlease address the above before we proceed to review your PR."
await github.rest.issues.createComment({
Expand Down

0 comments on commit a39ba95

Please sign in to comment.