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 28, 2024
1 parent 33654c2 commit 6a2e50a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ jobs:
return match ? parseInt(match[1]) : null
};
const issueNumber = extractIssueNumber(pr.data.body)
let isIssueOpen = false
if (issueNumber) {
const issue = await github.rest.issues.get({
owner: 'TEAMMATES',
repo: 'teammates',
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber
});
isIssueOpen = issue.data.state === 'open'
const isIssueOpen = issue.data.state === 'open'
if (isTitleValid && isDescriptionValid && isIssueOpen) {
return
}
Expand All @@ -49,7 +48,7 @@ jobs:
if (!isDescriptionValid) {
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) {
if (!isIssueOpen && issueNumber) {
body += "- The issue referenced in the description (#" + issueNumber + ") is not open.\n"
}
body += "\nPlease address the above before we proceed to review your PR."
Expand Down

0 comments on commit 6a2e50a

Please sign in to comment.