DEV Community

Alpha Olomi
Alpha Olomi

Posted on

2 2

SMS Notifications with Action Africastalking

A GitHub Action to send a text message to the mobile number of choice via AfricastalkingSMS API

Action Africastalking

Submission Category: DIY Deployments

Yaml File and Link to Code

GitHub logo alphaolomi / actions-africastalking

Send an SMS from GitHub Actions using Africastalking Programmable SMS

📨 Africastalking SMS Action

A GitHub Action to send a text message to mobile number of choice using Africastalking Programmable SMS

Usage

  1. Create a .github/workflows/sms.yml file in your repository.
  2. Add the following content to the sms.yml file:
name: SMS Notification
on:
  pull_request:

jobs:
  smsNotification:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: alphaolomi/actions-africastalking@main
        with:
          fromPhoneNumber: 'INFO' # or secrets.fromPhoneNumber
          toPhoneNumber: ${{ secrets.toPhoneNumber }}
          message: 'Hello World'
        env:
          AT_API_KEY: ${{ secrets.AT_API_KEY }}
          AT_USERNAME: ${{ secrets.AT_USERNAME }}
Enter fullscreen mode Exit fullscreen mode
  1. Add the following secrets to your repository:
  • AT_API_KEY - Your Africastalking API Key
  • AT_USERNAME - Your Africastalking Username

Inputs

  • AT_API_KEY Required. You can get this from the Africastalking's Dashboard.
  • AT_USERNAME Required. Use 'sandbox' as the value for development in the test environment
  • fromPhoneNumber Required. The name or number the message will…

on: push
name: Africastalking Notification Demo
jobs:
  africastalkingNotification:
    name: Africastalking Notification
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Africastalking Notification
      uses: alphaolomi/action-africastalking-@master
      env:        
        AT_API_KEY: ${{ secrets.AT_API_KEY }} 
        AT_USERNAME: ${{ secrets.AT_USERNAME }} 
        AT_MOBILE_NUMBER: ${{ secrets.AT_MOBILE_NUMBER }} 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay