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`)
141
+
listFilesWithOwners(changedFiles,cwd)
142
+
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Sorry @${sender}, you don't have access to these files: ${pathListToMarkdown(filesWhichArentOwned)}.`})
console.log(`@${sender} does not have access to merge \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 merge:\n${pathListToMarkdown(filesWhichArentOwned)}`});
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.`});
143
-
return
144
-
}
154
+
asyncmergeIfHasAccess(){
155
+
constprInfo=awaitthis.getTargetPRIfHasAccess()
156
+
if(!prInfo){
157
+
return
158
+
}
145
159
146
-
if(prInfo.data.state.toLowerCase()!=="open"){
147
-
awaitoctokit.issues.createComment({ ...thisRepo,issue_number: issue.number,body: `Sorry @${sender}, this PR isn't open.`});
148
-
return
149
-
}
160
+
const{ octokit, thisRepo, issue, sender }=this;
161
+
162
+
// Don't try merge unmergable stuff
163
+
if(!prInfo.data.mergeable){
164
+
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