From 8aa8a07159b602fb47d75393bda77c6f9a7646e9 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Thu, 5 Sep 2024 22:00:23 +0300 Subject: [PATCH 1/2] Do not comment twice if backporting fails due to merge conflicts. Since we already posted a comment with the output of `git am`, we don't have to do it again in the exception's handler. Instead of throwing, we manually fail the step and exit. --- .github/workflows/backport-base.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backport-base.yml b/.github/workflows/backport-base.yml index 79355b9727e..ce337af8e63 100644 --- a/.github/workflows/backport-base.yml +++ b/.github/workflows/backport-base.yml @@ -152,7 +152,8 @@ jobs: issue_number: pr_number, body: git_am_failed_body }); - throw new Error("Error: git am failed, most likely due to a merge conflict.", false); + core.setFailed(new Error("Error: git am failed, most likely due to a merge conflict.", false)); + return; } else { // push the temp branch to the repository From 632df27d803cf30431af1704aaebe7eda84d2cb6 Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 24 Sep 2024 16:25:25 +0300 Subject: [PATCH 2/2] Simplify. --- .github/workflows/backport-base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport-base.yml b/.github/workflows/backport-base.yml index ce337af8e63..d9f833965ea 100644 --- a/.github/workflows/backport-base.yml +++ b/.github/workflows/backport-base.yml @@ -152,7 +152,7 @@ jobs: issue_number: pr_number, body: git_am_failed_body }); - core.setFailed(new Error("Error: git am failed, most likely due to a merge conflict.", false)); + core.setFailed("Error: git am failed, most likely due to a merge conflict."); return; } else {