From a5fbeae7535ae3261a8efa12c4b5cd085a3ffe71 Mon Sep 17 00:00:00 2001 From: Oscar Vestlie Date: Tue, 14 Nov 2023 13:44:32 -0800 Subject: [PATCH] Fix multiple labels --- .github/workflows/label-cherry-pick.yaml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/label-cherry-pick.yaml b/.github/workflows/label-cherry-pick.yaml index e9ff484b30c89..e93df7d48b6ce 100644 --- a/.github/workflows/label-cherry-pick.yaml +++ b/.github/workflows/label-cherry-pick.yaml @@ -37,18 +37,12 @@ jobs: if [[ $branch == $BASE_REF ]]; then continue fi - - for label in $labels; do - if [[ $label == "cp-$branch" ]]; then - echo $branch - filtered_branches+=("$branch") - fi - done + if [[ ${labels[@]} =~ "cp-$branch" ]]; then + filtered_branches+=("$branch") + fi done - echo -n "$filtered_branches" | jq -cRs 'split("\n")' - - echo "target_branch=$(echo -n "$filtered_branches" | jq -cRs 'split("\n")')" >> $GITHUB_OUTPUT + echo "target_branch=$(echo -n "${filtered_branches[@]}" | jq -cRs 'split(" ")')" >> $GITHUB_OUTPUT cherry_pick: runs-on: ubuntu-latest