From 0bbb1ddc804c19f6d941eaf944431e7d93983583 Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Fri, 29 Nov 2024 11:42:40 +0100 Subject: [PATCH] Fix automated PR script Signed-off-by: gabriel-farache --- scripts/create_or_update_automated_pr.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/create_or_update_automated_pr.sh b/scripts/create_or_update_automated_pr.sh index 55ad2624..9ce12050 100644 --- a/scripts/create_or_update_automated_pr.sh +++ b/scripts/create_or_update_automated_pr.sh @@ -42,11 +42,15 @@ for pr in $prs; do git config --global user.name "${USER_NAME}" # Get the PR details (branch) pr_labels=$(gh pr view "$pr" --repo "$REPO" --json labels --jq '.labels[].name') - if [[ ${pr_labels[*]} =~ "do-not-merge" ]] - then - echo "PR $pr is labeled with do-not-merge, ignoring it" - exit 0 - fi + for label in "${pr_labels[@]}" + do + if [[ "$label" =~ "do-not-merge" ]] + then + echo "PR $pr is labeled with do-not-merge, ignoring it" + exit 0 + fi + done + pr_branch=$(gh pr view "$pr" --repo "$REPO" --json headRefName --jq '.headRefName')