pushbag
Agents and tools

Send a phone notification from GitHub Actions

A GitHub Actions step can post the job result to pushbag with curl. Store a Notifications key as an Actions secret and link the message to the workflow run.

Last updated:

Prepare the workflow and secret

In the repository’s Actions secrets, create PUSHBAG_API_KEY with the value of a pushbag Notifications key. To make the key on a workstation, install the CLI with npm install -g @pushbag/cli, run pushbag auth login, and open the printed page. Grant the key access to Personal or to the particular channel this repository should write to. Put the value in the secret store before enabling the workflow step.

Edit your existing workflow in .github/workflows, for example .github/workflows/test.yml. For an agent helping with the edit, run pushbag guide pushbag --install in the local checkout. It writes .agents/skills/pushbag/SKILL.md with the HTTP payload formats. The hosted runner does not need to install the skill or publish an artifact for this example.

Send the result of a job

Create a secret named PUSHBAG_API_KEY with permission to publish to your personal channel. Add this final step to a job that runs on a Linux runner. GitHub Actions secrets

- name: Send job result to pushbag
  if: ${{ always() }}
  env:
    PUSHBAG_API_KEY: ${{ secrets.PUSHBAG_API_KEY }}
    JOB_STATUS: ${{ job.status }}
  run: |
    curl --fail-with-body --silent --show-error https://ping.pushbag.dev/ \
      -H "Authorization: Bearer $PUSHBAG_API_KEY" \
      -H 'Content-Type: application/json' \
      --data-binary "{\"message\":\"Job $GITHUB_JOB finished with $JOB_STATUS\",\"click\":\"$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"}"

Check delivery before changing the workflow

With the CLI installed and the same key set locally, send a test and confirm it reaches the expected channel.

pushbag notify "Actions delivery test" --title "CI setup"

Inspect a success and a failure

Run the workflow on a trusted branch. At the end of the job, the phone message should include the job identifier and its status. Tap it to open the run on GitHub. A successful publish does not grant access to the repository, so use a browser that is signed in to the correct GitHub account to view private logs.

Check the behavior on an ordinary failing test as well. The final step uses the job status after earlier steps and can therefore report a failure even when the test step stopped normal processing. If a notification failure should have no bearing on a successful build, apply continue-on-error: true to the notification step and inspect that step’s log when a message goes missing.

For workflows with a large test matrix, adding an alert to every matrix job can produce several messages for one push. Put the step in the particular job you need to review, or aggregate upstream results in a separate job and send one summary. In a summary job, read the upstream results explicitly. Its own job status describes the summary job.

Skip secret-dependent delivery when the triggering workflow does not receive the secret. Publishing to an open channel as a fallback would send repository activity to a different audience.

Frequently asked questions

Will this work in a pull request from a fork?

GitHub generally withholds repository secrets from workflows triggered by fork pull requests. Put this step in a trusted workflow that receives the secret.

Where does this step go in my repository?

Add it after the build or test steps in a workflow under .github/workflows. The job status at that point describes the work that has already run.

Does the runner need a pushbag skill?

The HTTP step runs with curl and a secret. Install the CLI guide locally only if an agent helps author or maintain the workflow.

Can I link straight to the workflow attempt?

The example links to the run identified by GITHUB_RUN_ID. Include the attempt number in the message when you need to distinguish reruns in the channel.