Skip to content

Commit

Permalink
Merge pull request #40 from saschanaz/patch-1
Browse files Browse the repository at this point in the history
Do not early return when no relevant code owner exists
  • Loading branch information
orta authored Apr 28, 2024
2 parents 311c487 + fce1927 commit 7c66472
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ async function commentOnMergablePRs() {
core.info(`Code-owners: \n - ${codeowners.users.join("\n - ")}`)
core.info(`Labels: \n - ${codeowners.labels.join("\n - ")}`)

if (!codeowners.users.length) {
console.log("This PR does not have any code-owners")
process.exit(0)
}




// Determine who has access to merge every file in this PR
const ownersWhoHaveAccessToAllFilesInPR = []
codeowners.users.forEach(owner => {
Expand All @@ -86,6 +78,11 @@ async function commentOnMergablePRs() {
process.exit(0)
}

if (!codeowners.users.length) {
console.log("This PR does not have any code-owners")
process.exit(0)
}

const ourSignature = "<!-- Message About Merging -->"
const comments = await octokit.issues.listComments({ ...thisRepo, issue_number: pr.number })
const existingComment = comments.data.find(c => c.body.includes(ourSignature))
Expand Down

0 comments on commit 7c66472

Please sign in to comment.