chore(workflows): Add link to merged PR
This commit is contained in:
parent
b095cdd0e7
commit
01558e1437
2 changed files with 22 additions and 2 deletions
|
|
@ -22,7 +22,6 @@ jobs:
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
TF_VAR_proxmox_endpoint: ${{ secrets.PROXMOX_ENDPOINT }}
|
TF_VAR_proxmox_endpoint: ${{ secrets.PROXMOX_ENDPOINT }}
|
||||||
TF_VAR_proxmox_api_token: ${{ secrets.PROXMOX_API_TOKEN }}
|
TF_VAR_proxmox_api_token: ${{ secrets.PROXMOX_API_TOKEN }}
|
||||||
PR_NUMBER: ${{ forge.event.pull_request.number }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/checkout@v4
|
- uses: https://github.com/actions/checkout@v4
|
||||||
- uses: https://github.com/opentofu/setup-opentofu@v1
|
- uses: https://github.com/opentofu/setup-opentofu@v1
|
||||||
|
|
@ -56,10 +55,21 @@ jobs:
|
||||||
run: tofu apply -auto-approve -no-color
|
run: tofu apply -auto-approve -no-color
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Get merged PR
|
||||||
|
id: pr
|
||||||
|
run: |
|
||||||
|
pr_number=$(curl -s \
|
||||||
|
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
"${{ forge.api_url }}/repos/${{ forge.repository }}/commits/${{ forge.sha }}/pull" \
|
||||||
|
| jq -r '.number // empty')
|
||||||
|
|
||||||
|
echo "${pr_number}"
|
||||||
|
|
||||||
- name: Add comment
|
- name: Add comment
|
||||||
id: comment
|
id: comment
|
||||||
if: always()
|
if: always()
|
||||||
env:
|
env:
|
||||||
|
PR_NUMBER: ${{ steps.pr.outputs.stdout }}
|
||||||
COMMENT_BODY: |
|
COMMENT_BODY: |
|
||||||
### ${{forge.workflow}}
|
### ${{forge.workflow}}
|
||||||
#### ${{ steps.fmt.outcome == 'success' && '✅' || '❌' }} OpenTofu Format and Style 🖌
|
#### ${{ steps.fmt.outcome == 'success' && '✅' || '❌' }} OpenTofu Format and Style 🖌
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ jobs:
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
TF_VAR_proxmox_endpoint: ${{ secrets.PROXMOX_ENDPOINT }}
|
TF_VAR_proxmox_endpoint: ${{ secrets.PROXMOX_ENDPOINT }}
|
||||||
TF_VAR_proxmox_api_token: ${{ secrets.PROXMOX_API_TOKEN }}
|
TF_VAR_proxmox_api_token: ${{ secrets.PROXMOX_API_TOKEN }}
|
||||||
PR_NUMBER: ${{ forge.event.pull_request.number }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: https://github.com/actions/checkout@v4
|
- uses: https://github.com/actions/checkout@v4
|
||||||
- uses: https://github.com/opentofu/setup-opentofu@v1
|
- uses: https://github.com/opentofu/setup-opentofu@v1
|
||||||
|
|
@ -56,10 +55,21 @@ jobs:
|
||||||
run: tofu apply -auto-approve -no-color
|
run: tofu apply -auto-approve -no-color
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: Get merged PR
|
||||||
|
id: pr
|
||||||
|
run: |
|
||||||
|
pr_number=$(curl -s \
|
||||||
|
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
|
"${{ forge.api_url }}/repos/${{ forge.repository }}/commits/${{ forge.sha }}/pull" \
|
||||||
|
| jq -r '.number // empty')
|
||||||
|
|
||||||
|
echo "${pr_number}"
|
||||||
|
|
||||||
- name: Add comment
|
- name: Add comment
|
||||||
id: comment
|
id: comment
|
||||||
if: always()
|
if: always()
|
||||||
env:
|
env:
|
||||||
|
PR_NUMBER: ${{ steps.pr.outputs.stdout }}
|
||||||
COMMENT_BODY: |
|
COMMENT_BODY: |
|
||||||
### ${{forge.workflow}}
|
### ${{forge.workflow}}
|
||||||
#### ${{ steps.fmt.outcome == 'success' && '✅' || '❌' }} OpenTofu Format and Style 🖌
|
#### ${{ steps.fmt.outcome == 'success' && '✅' || '❌' }} OpenTofu Format and Style 🖌
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue