You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.log(`@${sender} does not have access to \n - ${filesWhichArentOwned.join("\n - ")}\n`)
134
+
listFilesWithOwners(changedFiles,cwd)
135
+
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Sorry @${sender}, you don't have access to these files: ${filesWhichArentOwned.join(", ")}.`})
console.log(`@${sender} does not have access to merge \n - ${filesWhichArentOwned.join("\n - ")}\n`)
127
-
listFilesWithOwners(changedFiles,cwd)
128
-
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Sorry @${sender}, you don't have access to merge: ${filesWhichArentOwned.join(", ")}.`});
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Sorry @${sender}, this PR has merge conflicts. They'll need to be fixed before this can be merged.`});
136
-
return
137
-
}
147
+
asyncmergeIfHasAccess(){
148
+
constprInfo=awaitthis.getTargetPRIfHasAccess()
149
+
if(!prInfo){
150
+
return
151
+
}
138
152
139
-
if(prInfo.data.state.toLowerCase()!=="open"){
140
-
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Sorry @${sender}, this PR isn't open.`});
141
-
return
142
-
}
153
+
const{ octokit, thisRepo, issue, sender }=this;
154
+
155
+
// Don't try merge unmergable stuff
156
+
if(!prInfo.data.mergeable){
157
+
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Sorry @${sender}, this PR has merge conflicts. They'll need to be fixed before this can be merged.`});
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Sorry @${sender}, this PR could not be merged because it wasn't green. Blocked by [${failedStatus.context}](${failedStatus.target_url}): '${failedStatus.description}'.`});
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Sorry @${sender}, this PR could not be merged because it wasn't green. Blocked by [${failedStatus.context}](${failedStatus.target_url}): '${failedStatus.description}'.`});
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Merging because @${sender} is a code-owner of all the changes - thanks!`});
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `There was an issue merging, maybe try again ${sender}. <a href="${linkToCI}">Details</a>`});
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Merging because @${sender} is a code-owner of all the changes - thanks!`});
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `There was an issue merging, maybe try again ${sender}. <a href="${linkToCI}">Details</a>`});
0 commit comments