Skip to content

Commit

Permalink
ci: Add notify PR status workflow
Browse files Browse the repository at this point in the history
To get the status updated in slack
  • Loading branch information
tomi committed Nov 21, 2024
1 parent 78a10b2 commit acc24a1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/notify-pr-status.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Notify PR status changed

on:
pull_request_review:
types: [submitted, dismissed]
pull_request:
types: [closed]

jobs:
notify:
runs-on: ubuntu-latest
if: >-
(github.event_name == 'pull_request_review' && github.event.review.state == 'approved') ||
(github.event_name == 'pull_request_review' && github.event.review.state == 'dismissed') ||
(github.event_name == 'pull_request' && github.event.pull_request.merged == true) ||
(github.event_name == 'pull_request' && github.event.pull_request.merged == false && github.event.action == 'closed')
steps:
- uses: fjogeleit/http-request-action@bf78da14118941f7e940279dd58f67e863cbeff6 # v1
name: Notify
env:
PR_URL: ${{ github.event.pull_request.html_url }}
with:
url: ${{ secrets.N8N_NOTIFY_PR_STATUS_CHANGED_URL }}
method: "POST"
customHeaders: '{ "x-api-token": "${{ secrets.N8N_NOTIFY_PR_STATUS_CHANGED_TOKEN }}" }'
data: '{ "event_name": "${{ github.event_name }}", "pr_url": "${{ env.PR_URL }}", "event": ${{ toJSON(github.event) }} }'

0 comments on commit acc24a1

Please sign in to comment.