mirror of
https://github.com/taigrr/github-to-signal.git
synced 2026-04-02 03:09:09 -07:00
33 lines
1.3 KiB
YAML
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 }}"
|
|
}'
|