GitHub Actions Integration
Add push notifications to your CI/CD workflows.
Setup
- Go to your repository Settings > Secrets and variables > Actions
- Click New repository secret
- Name:
PING_WEBHOOK_URL - Value: Your webhook URL
- Click Add secret
Basic Workflow
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy
run: ./deploy.sh
- name: Notify Success
if: success()
run: |
curl -X POST '${{ secrets.PING_WEBHOOK_URL }}' \
-H 'Content-Type: application/json' \
-d '{
"title": "Deploy Complete",
"body": "${{ github.repository }} deployed",
"actions": [
{"type": "url", "label": "View Run", "value": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
]
}'
- name: Notify Failure
if: failure()
run: |
curl -X POST '${{ secrets.PING_WEBHOOK_URL }}' \
-H 'Content-Type: application/json' \
-d '{
"title": "Deploy Failed",
"body": "${{ github.repository }} - ${{ github.ref_name }}",
"priority": "high",
"actions": [
{"type": "url", "label": "View Run", "value": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}
]
}'Preview
Deploy Complete
just now${{ github.repository }} deployed
Reusable Notification Step
Create a reusable action in .github/actions/ping/action.yml:
name: 'Send Ping Notification'
description: 'Send a push notification via Ping'
inputs:
webhook_url:
description: 'Ping webhook URL'
required: true
title:
description: 'Notification title'
required: true
body:
description: 'Notification body'
required: false
priority:
description: 'Notification priority (low, normal, high)'
required: false
default: 'normal'
runs:
using: 'composite'
steps:
- run: |
curl -X POST '${{ inputs.webhook_url }}' \
-H 'Content-Type: application/json' \
-d '{
"title": "${{ inputs.title }}",
"body": "${{ inputs.body }}",
"priority": "${{ inputs.priority }}"
}'
shell: bashPreview
${{ inputs.title }}
just now${{ inputs.body }}
Then use it:
- uses: ./.github/actions/ping
with:
webhook_url: ${{ secrets.PING_WEBHOOK_URL }}
title: "Build Complete"
body: "All tests passed"Alternative: Use the GitHub Transformer
Instead of custom notifications, point GitHub's built-in webhooks to Ping:
- Go to repository Settings > Webhooks
- Add webhook:
https://ping-api-production.up.railway.app/v1/webhook/github/YOUR_TOKEN - Content type:
application/json - Select events: Workflow runs, Push
Ping automatically formats GitHub events into nice notifications.