Skip to content

Commit

Permalink
Automatically add backport main label for release-pr (#2473) (#2475)
Browse files Browse the repository at this point in the history
* feat: automatically add backport main label for release-pr



* fix: deleted unnecessary quotation



---------

Signed-off-by: Hiroto Funakoshi <hiroto.funakoshi.hiroto@gmail.com>
  • Loading branch information
hlts2 authored Apr 2, 2024
1 parent cf3be2e commit 0e54080
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/_release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,24 @@ jobs:
git commit -S --signoff -m ":bookmark: :robot: Release ${RELEASE_TAG}"
git push -u origin ${PREPARE_RELEASE_BRANCH_NAME}
curl --include --verbose --fail \
PR_NUM=$(curl --fail \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
--request POST \
--data "{\"title\": \":bookmark: :robot: Release ${RELEASE_TAG}\", \"head\": \"${PREPARE_RELEASE_BRANCH_NAME}\", \"base\": \"${RELEASE_BRANCH_NAME}\", \"body\": \"Release PR for ${RELEASE_TAG}.\", \"maintainer_can_modify\": true}" \
$API_URL
${API_BASE_URL}/pulls | jq '.number' )
echo ${PR_NUM}
curl --fail \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-H "Authorization: token ${GITHUB_TOKEN}" \
--request POST \
--data "{\"labels\":[\"${BACKPORT_MAIN_LABEL_NAME}\"]}" \
${API_BASE_URL}/issues/${PR_NUM}/labels
env:
GITHUB_USER: ${{ secrets.DISPATCH_USER }}
GITHUB_TOKEN: ${{ secrets.DISPATCH_TOKEN }}
API_URL: https://api.github.com/repos/vdaas/vald/pulls
BACKPORT_MAIN_LABEL_NAME: actions/backport/main
API_BASE_URL: https://api.github.com/repos/vdaas/vald

0 comments on commit 0e54080

Please sign in to comment.