mirror of
https://github.com/taigrr/github-to-signal.git
synced 2026-04-02 03:09:09 -07:00
dynamic endpoints
This commit is contained in:
32
examples/signal-notify.yml
Normal file
32
examples/signal-notify.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Signal Notification
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["CI"]
|
||||
types: [completed]
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Notify Signal on failure
|
||||
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
||||
run: |
|
||||
curl -sf -X POST "${{ secrets.SIGNAL_ENDPOINT }}/ci" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-CI-Secret: ${{ secrets.SIGNAL_API_KEY }}" \
|
||||
-d '{
|
||||
"source": "${{ github.repository }}",
|
||||
"message": "❌ Workflow \"${{ github.event.workflow_run.name }}\" failed on ${{ github.event.workflow_run.head_branch }}\n${{ github.event.workflow_run.html_url }}"
|
||||
}'
|
||||
|
||||
- name: Notify Signal on success
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
run: |
|
||||
curl -sf -X POST "${{ secrets.SIGNAL_ENDPOINT }}/ci" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-CI-Secret: ${{ secrets.SIGNAL_API_KEY }}" \
|
||||
-d '{
|
||||
"source": "${{ github.repository }}",
|
||||
"message": "✅ Workflow \"${{ github.event.workflow_run.name }}\" succeeded on ${{ github.event.workflow_run.head_branch }}\n${{ github.event.workflow_run.html_url }}"
|
||||
}'
|
||||
Reference in New Issue
Block a user