Ping

GitHub Actions Integration

Add push notifications to your CI/CD workflows.


Setup

  1. Go to your repository Settings > Secrets and variables > Actions
  2. Click New repository secret
  3. Name: PING_WEBHOOK_URL
  4. Value: Your webhook URL
  5. 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: bash

Preview

${{ 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:

  1. Go to repository Settings > Webhooks
  2. Add webhook: https://ping-api-production.up.railway.app/v1/webhook/github/YOUR_TOKEN
  3. Content type: application/json
  4. Select events: Workflow runs, Push

Ping automatically formats GitHub events into nice notifications.