Skip to content

Commit

Permalink
[MIRROR] Makes test merge bot continue with other PRs if updating one…
Browse files Browse the repository at this point in the history
… fails. (#2057) (#2949)

* Makes test merge bot continue with other PRs if updating one fails. (#82717)

Right now updating
tgstation/tgstation#81089 (comment)
fails because it exceeds github character limit for comments.

This will make it work until backed is updated.

* Makes test merge bot continue with other PRs if updating one fails.

---------

Co-authored-by: NovaBot <[email protected]>
Co-authored-by: AnturK <[email protected]>
  • Loading branch information
3 people authored Apr 19, 2024
1 parent 58fea88 commit 93492b8
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions tools/test_merge_bot/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,41 @@ export async function processTestMerges({ github, context }) {
}

if (existingComment === undefined) {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: newBody,
});
try {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: prNumber,
body: newBody,
});
} catch (error) {
if(error.status){
console.error(`Failed to create comment for #{prNumber}`)
console.error(error)
continue;
}
else{
throw error
}
}
} else {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.databaseId,
body: newBody,
});
try {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: existingComment.databaseId,
body: newBody,
});
} catch (error) {
if(error.status){
console.error(`Failed to update comment for #{prNumber}`)
console.error(error)
continue;
}
else{
throw error
}
}
}
}
}

0 comments on commit 93492b8

Please sign in to comment.