forked from MapComplete/MapComplete
Actions: automatically add comment on PR
This commit is contained in:
parent
bfd6874516
commit
0f897306a0
1 changed files with 12 additions and 0 deletions
|
@ -62,5 +62,17 @@ jobs:
|
|||
- name: unzipping remote file
|
||||
run: ssh hetzner "cd /root/staging && rm -rf ${{ github.ref_name }} && unzip ${{ github.ref_name }}.zip && rm -rf /root/public/${{ github.ref_name }} && mv /root/staging/${{ github.ref_name }}/ /root/public/ && rm ${{ github.ref_name }}.zip"
|
||||
|
||||
- name: Extract PR number
|
||||
run: echo "PR_NUMBER=$(echo $FORGEJO_REF_NAME | cut -d'/' -f3)" >> $FORGEJO_ENV
|
||||
|
||||
- name: add comment to PR
|
||||
if: env.PR_NUMBER != ''
|
||||
run: |
|
||||
curl -X POST "https://source.mapcomplete.org/api/v1/repos/${FORGEJO_REPOSITORY}/issues/${PR_NUMBER}/comments" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: token $FORGEJO_TOKEN" \
|
||||
-d '{"body": "This PR has been deployed and is (temporarily) available on https://builds.mapcomplete.org/${PR_NUMBER}"}'
|
||||
env:
|
||||
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue