Files
github-to-signal/examples/signal-notify.yml
2026-03-23 21:32:20 -04:00

33 lines
1.3 KiB
YAML

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 }}"
}'