GitHub Action
Send an SMS from any GitHub workflow: when a deploy fails, a release ships or a nightly job breaks. One step, no dependencies, on Linux, macOS and Windows runners.
- Action: Send SMS with curl-sms on the GitHub Marketplace
- Source: github.com/curl-sms/send-sms (MIT)
Setup
- Create an API key. Start with a test key (
cs_test_…): every check runs, nothing is sent and nothing is charged. - Add it as a repository secret named
CURLSMS_API_KEY(Settings → Secrets and variables → Actions). - Add the step to your workflow.
SMS when a job fails
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- run: ./deploy.sh
- name: SMS on failure
if: failure()
uses: curl-sms/send-sms@v1
with:
api-key: ${{ secrets.CURLSMS_API_KEY }}
receiver: "+4915123456789"
body: "Deploy failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
Up to 100 numbers fit in receiver, separated by new lines or commas. Keep numbers out of public workflow files with a secret or variable, e.g. receiver: ${{ vars.ONCALL_PHONE }}.
Inputs
| Input | Required | Description |
|---|---|---|
api-key |
yes | curl-sms API key. Always pass it from a secret. |
receiver |
yes | Mobile number(s) in international format (+49…), up to 100, separated by commas or new lines. |
body |
yes | SMS text. 160 characters per part (70 with emoji), at most 10 parts. |
send-at |
no | RFC 3339 time to send later (at most one year ahead). |
idempotency-key |
no | Same key and request within 24 hours never sends twice. Default: derived from run, attempt, job and message. |
fail-on-error |
no | false turns a rejected SMS into a warning instead of failing the step. Default: true. |
language |
no | Language of error messages (en or de). Default: en. |
Outputs
| Output | Description |
|---|---|
id |
ID of the SMS (the first one when sending to several receivers) |
ids |
JSON array of all SMS IDs |
status |
queued, or scheduled with send-at |
mode |
live or test |
segments |
Number of SMS parts per receiver |
price |
Price in euros taken from the balance |
- id: sms
uses: curl-sms/send-sms@v1
with:
api-key: ${{ secrets.CURLSMS_API_KEY }}
receiver: ${{ vars.ONCALL_PHONE }}
body: "Nightly build broke"
- run: echo "SMS ${{ steps.sms.outputs.id }} is ${{ steps.sms.outputs.status }}"
Good to know
- No duplicates on re-run. The default idempotency key comes from the run, attempt, job and message, so a retry or timeout never sends a second SMS.
- Privacy. The API key is masked in logs. Log and job summary show only the last four digits of each number.
- Errors. A rejected SMS fails the step with the error code, e.g.
invalid_receiverorinsufficient_balance.