@@ -54,7 +54,7 @@ jobs:
|
||||
./render-stack.sh
|
||||
env:
|
||||
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
|
||||
- name: Commit to swarm-cd
|
||||
- name: Commit to swarm-cd and create PR
|
||||
run: |
|
||||
git config --global user.email "rui.hu@cleverthis.com" # TODO: make this configurable
|
||||
git config --global user.name "Rui Hu (Pipeline)" # TODO: make this configurable
|
||||
@@ -66,6 +66,24 @@ jobs:
|
||||
git add compose.prod.yaml
|
||||
git commit -m "Release deployment for $branchName"
|
||||
git push -u origin "$branchName"
|
||||
|
||||
echo "URL: $GITHUB_SERVER_URL/api/v1/repos/$REPO/pulls"
|
||||
response=$(curl -X 'POST' \
|
||||
"https://git.cleverthis.com/api/v1/repos/hurui200320/deployment-target/pulls" \
|
||||
-H 'accept: application/json' \
|
||||
-H "Authorization: token $GIT_PASSWORD" \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"assignees": "${{ inputs.pr-asignee }}",
|
||||
"base": "main",
|
||||
"body": "This is an automatically generated PR for release deployment branch $branchName",
|
||||
"head": "$branchName",
|
||||
"title": "Release deployment for $branchName"
|
||||
}')
|
||||
# echo $response | jq .
|
||||
pr_number=$(echo $response | jq -r '.number')
|
||||
echo "PR Number: $pr_number"
|
||||
echo pr_number=$pr_number >> $GITHUB_OUTPUT
|
||||
env:
|
||||
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
|
||||
GIT_PASSWORD: ${{ secrets.GIT_PASSWORD }}
|
||||
|
||||
Reference in New Issue
Block a user