SMS alerts when GitHub action fails using Twilio
What you’ll need for this:
- A Twilio Account. Sign up for free
- A Twilio phone number
- A Twilio API Key and Secret
- GitHub Actions
We will be using the Twilio SMS Action from the Actions marketplace.
-
Set up your credentials as secrets in your repository settings using
TWILIO_ACCOUNT_SID,TWILIO_API_KEY,TWILIO_API_SECRET -
Add the following to your workflow
- name: 'Sending SMS Notification'
uses: twilio-labs/actions-sms@v1
with:
fromPhoneNumber: '+1(234)5678901'
toPhoneNumber: '+1(234)3334444'
message: 'Hello from Twilio'
env:
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_API_KEY: ${{ secrets.TWILIO_API_KEY }}
TWILIO_API_SECRET: ${{ secrets.TWILIO_API_SECRET }}