From dfdf0d1bb0758d263044252c1585e6c3e052973f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claudio=20Andr=C3=A9?= Date: Fri, 22 Nov 2024 11:21:13 -0300 Subject: [PATCH] feat(merge-bot): add a new command (#646) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow the bot to retrieve the current state of the PR. Signed-off-by: Claudio André --- requirements.hash | 2 +- scripts/merge_procedures.sh | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/requirements.hash b/requirements.hash index a726e3f7..534951be 100644 --- a/requirements.hash +++ b/requirements.hash @@ -1,7 +1,7 @@ 8eaf3bbf120f883f688e100b9329ce9629a78f2c775239d7483efd937240f942 ./ci_controller.sh e25fca925ee687bc46f5be6487c48ee977b697d05df97ccaca86d36ee8d213dc ./clean_package.sh 829470da958b5afce3b2023d66eeac9b41d493e9ad8c20fca25109e156312cf0 ./helper.sh -d2bb94dd278db17724bfe41d2cd3794f878a706aabc3a8bda6dec6913a420461 ./merge_procedures.sh +75de2f0f7c4c02dd16baab447492de281e90e8413f276f86d6a5faeec9dc9025 ./merge_procedures.sh 9e0f8478bb6568b6defc647080637b2944d68e8372655031750849aa77686812 ./package_version.sh ad0a8ec80ac460df49a2643a5ea75c98ebe55e6039515ff3b8fc581c974ba698 ./run_tests.sh 94b462117f4a77f14703c5774a8477dcf6644bfee75bec158c0407e69ba58c73 ./show_info.sh diff --git a/scripts/merge_procedures.sh b/scripts/merge_procedures.sh index 1fcf28ad..1c40f132 100755 --- a/scripts/merge_procedures.sh +++ b/scripts/merge_procedures.sh @@ -57,14 +57,23 @@ echo "reviewDecision: $(gh pr view "$PR_URL" --json reviewDecision)" echo "mergeStateStatus: $(gh pr view "$PR_URL" --json mergeStateStatus)" echo "**********************************************************************" -if [[ "$REQUEST" == "bot: MERGE skip" ]]; then +if [[ "$REQUEST" == "bot: MERGE status" || "$SKIP" == "true" ]]; then test "$REVIEWS_STATUS" == "APPROVED" && MARK_1="✔" - test "$MERGE_STATUS" == "CLEAN" && MARK_2="✔" + + if [[ "$MERGE_STATUS" == "CLEAN" ]]; then + MARK_2="✔" + else + MARK_2="❌" + fi gh pr comment "$PR_URL" --body " 🤖: status - reviewDecision: $REVIEWS_STATUS $MARK_1 - mergeStateStatus: $MERGE_STATUS $MARK_2 " + + if [[ "$REQUEST" == "bot: MERGE status" ]]; then + exit 0 + fi fi git config --global user.name "github-actions[bot]" git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"