Skip to content

Commit 59be562

Browse files
committed
Don't post a merge conflict comment if another error happened
A bit of weird logic. Signed-off-by: Yarden Shoham <[email protected]>
1 parent 057ac08 commit 59be562

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/prActions.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ const execute = async (
66
pr: { number: number; user: { login: string } },
77
) => {
88
if (label === "giteabot/update-branch") {
9-
await updateBranch(pr);
9+
const err = await updateBranch(pr);
10+
if (err) {
11+
await addComment(pr.number, `I failed to update the branch because of the following error: ${err.message} Sorry about that. :tea:`);
12+
return;
13+
}
1014
await removeLabel(pr.number, "giteabot/update-branch");
1115
}
1216
};
@@ -27,6 +31,7 @@ export const updateBranch = async (
2731
`Failed to sync PR #${pr.number}`,
2832
);
2933
console.error(JSON.stringify(body));
34+
return Error(JSON.stringify(body?.message));
3035
}
3136

3237
console.info(

0 commit comments

Comments
 (0)