Skip to content

Commit 8c1568c

Browse files
authored
Don't post a merge conflict comment if another error happened (#142)
A bit of weird logic. --------- Signed-off-by: Yarden Shoham <[email protected]>
1 parent 057ac08 commit 8c1568c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/prActions.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ 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(
12+
pr.number,
13+
`I failed to update the branch because of the following error: ${err.message} Sorry about that. :tea:`,
14+
);
15+
return;
16+
}
1017
await removeLabel(pr.number, "giteabot/update-branch");
1118
}
1219
};
@@ -27,6 +34,7 @@ export const updateBranch = async (
2734
`Failed to sync PR #${pr.number}`,
2835
);
2936
console.error(JSON.stringify(body));
37+
return Error(JSON.stringify(body?.message));
3038
}
3139

3240
console.info(

0 commit comments

Comments
 (0)