From c713fcb633dc3bf3d6a486889e07da154a262748 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Fri, 26 Apr 2024 15:13:55 +0100 Subject: [PATCH] Update code freeze bot to check target PR branch correctly for issue_comment Signed-off-by: Andrew Leonard --- .github/workflows/code-freeze-new.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-freeze-new.yml b/.github/workflows/code-freeze-new.yml index f36541ca9..7dd16104f 100644 --- a/.github/workflows/code-freeze-new.yml +++ b/.github/workflows/code-freeze-new.yml @@ -34,7 +34,8 @@ jobs: if: github.event_name == 'pull_request_target' || (github.event_name == 'issue_comment' && github.event.issue.pull_request) id: get-pr-target-branch run: | - TARGET_BRANCH="$(gh pr view $PR_NUMBER --repo $REPOSITORY --json baseRefName --jq '.baseRefName')" + echo "Getting target branch" + TARGET_BRANCH="$(gh pr view "$PR_NUMBER" --repo "$REPOSITORY" --json baseRefName --jq '.baseRefName')" echo "pr_target_branch=$TARGET_BRANCH" >> "$GITHUB_OUTPUT" env: REPOSITORY: ${{ github.repository }} @@ -46,8 +47,8 @@ jobs: id: filter-branch # Following grep "regex" needs to exactly match the required target branches to "freeze" run: | - FILTERED_BRANCH="$(echo $PR_TARGET_BRANCH | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$')" - echo "filtered_code_freeze_branch=$FILTERED_BRANCH" >> $GITHUB_OUTPUT + FILTERED_BRANCH="$(echo "$PR_TARGET_BRANCH" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$')" + echo "filtered_code_freeze_branch=$FILTERED_BRANCH" >> "$GITHUB_OUTPUT" env: PR_TARGET_BRANCH: $${{ steps.get-pr-target-branch.outputs.pr_target_branch }}