Skip to content

Commit

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

Signed-off-by: Hiroto Funakoshi <hiroto.funakoshi.hiroto@gmail.com>

* fix: deleted unnecessary quotation

Signed-off-by: Hiroto Funakoshi <hiroto.funakoshi.hiroto@gmail.com>

---------

Signed-off-by: Hiroto Funakoshi <hiroto.funakoshi.hiroto@gmail.com>
  • Loading branch information
hlts2 committed Apr 2, 2024
1 parent 5ad9e27 commit df77a77
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 df77a77

Please sign in to comment.