diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index d803ddb5a3..d48714eb89 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -100,11 +100,11 @@ jobs: done pr_head=$(gh pr view ${{ steps.commit.outputs.pr_number }} --json headRepositoryOwner,headRefName --jq '.headRepositoryOwner.login + ":" + .headRefName') - response=$(curl -s -o response.json -w "%{http_code}" -X GET "${{ secrets.KVSTORE_URL }}/?key=head_$pr_head" \ + STATUS_CODE=$(curl -s -o response.json -w "%{http_code}" -X GET "${{ secrets.KVSTORE_URL }}/?key=head_$pr_head" \ -H "Authorization: Bearer ${{ secrets.KVSTORE_TOKEN }}") - if [ "$(cat response.json)" == "404" ]; then + if [ $STATUS_CODE == "404" ]; then target_branches=($target_milestones) - elif [ "$(cat response.json)" == "200" ]; then + elif [ $STATUS_CODE == "200" ]; then pr_base=$(jq -r '.value' response.json) target_branches=("backport/${pr_base}-to-${target_milestones[@]}") else