Guides · GitHub Actions
Count every deploy and flag failed runs from a GitHub Actions workflow
A curl step at the end of a workflow turns each run into an event: deploys become a count, and a failed run becomes a notification on your Mac. No marketplace action, one step.
Needs: the free EventBar app on your Mac, an EventBar account, and a GitHub Actions account with permission to add webhooks. About five minutes. Generic JSON.
Steps
- Create the webhook URL. In the EventBar dashboard, open the Webhooks tab, pick the group this belongs to (one group per site or app is the usual shape), choose the provider Generic JSON, name it, and press Create. Copy the URL; it stays visible and can be rotated any time.
- Paste it into GitHub Actions. In the workflow, add a last step with
if: always():- run: curl -sS -X POST -H "content-type: application/json" -d '{"event":"${{ job.status }}","repo":"${{ github.repository }}","ref":"${{ github.ref_name }}","url":"${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' "$HOOK"
withenv: HOOK: ${{ secrets.EVENTBAR_HOOK }}and the hook URL saved as a repository secret. Create the EventBar hook as Generic JSON with type fieldevent;job.statusissuccess,failureorcancelled. - Trigger one. Most services offer a test delivery; otherwise do the real thing once. It shows up in the dashboard's Events tab within a second and in the menu bar, as an undefined type named after the event. That first one is your proof the wiring works.
- Make it read well. Press Define on the new type and give it a title and a body template. Fields come from the payload, nested ones with dots. The table below is a starting point.
What you'll see
| Type | Title | Body template |
|---|---|---|
success | Deployed | {repo} · {ref} |
failure | Run failed | {repo} · {ref} |
cancelled | Cancelled | {repo} · {ref} |
Every type has its own switch in the menu bar, so a noisy one can be quiet on this Mac and still counted. Counts cover the last hour, 24 hours, 7 days, 30 days and all time.
Worth knowing
- The
urlfield becomes the notification's link, so a click on a failure opens the run's log. - For a deploy counter rather than a run counter, put the step only in the deploy job and send
"event":"deploy"; mutesuccessif you just want the number. - The repository webhook in the GitHub guide can send
workflow_runtoo, which flags failures without touching the workflow; the curl step wins when you want your own fields.
The full contract, including how each preset reads a payload and what the answers mean, is in the API docs. Something about GitHub Actions's payload changed? Tell us and we'll fix the guide.