Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Separate the kvstore's response body and status code #3265

Merged
merged 4 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading