Channel | SMS

It's simple. tyntec's programmable SMS API makes sending and receiving SMS easy. With our 100+ direct-to-carrier and 1200+ extremely reliable connections and over 15 years experience we offer you an programmable SMS API that is rich in features and customizable. You send and receive SMS and we handle the rest. Get familiar with our SMS API and learn how to send your first messages on the following pages.

SMS API | Integration with Github

image_integrations_guides_github_svg

GitHub is the most popular source code management and Distributed Version Control System (DVCS). For many users, monitoring changes in their repositories is a key requirement.

This guide will help you connect GitHub Actions to your phone. If there is any change in the repository, you will immediately receive an SMS message through the tyntec SMS API.

You will need

  • An active tyntec SMS API key.
  • A Github account.
  • Your favorite text editor with Syntax Highlighting.
  • Node.js installed.

Step One: Prepare your Github repository

    1. Create a new Github repository: /.github/workflows.
    2. Create a new file sms_notifications.yml. and README.md.

    3. Insert code into the build.yml file:

on:
  push:
    branches:
      - main
      - 'releases/*'
jobs:
  sms_notification:
    runs-on: ubuntu-latest
    steps:
      - uses: tyntec/github-action-sms@v1 # PATH TO TYNTEC GITHUB ACTION
        with:
          fromPhoneNumber: ${{ secrets.FROM_PHONE_NUMBER }} 
          toPhoneNumber: ${{ secrets.TO_PHONE_NUMBER }} 
          message: There are new changes in your GitHub repository.
        env:
          TYNTEC_API_KEY: ${{ secrets.TYNTEC_API_KEY }} 

Step Two: Create a new Github action

    1. Go to the Settings of your repository and click SecretsAction

    2. Click New repository secret.

    3. Insert one by one: FROM_PHONE_NUMBER, TO_PHONE_NUMBER, TYNTEC_API_KEY and their value.

    4. The Actions section should look like this:

Do you have the same result as in the screenshot? Perfect. Your secrets are all set.

Step Three: Test your app

    1. Open your favorite text editor.

    2. Clone your repository.

"git clone <repoUrl>"

    3. Make some changes in the README.md file.

    4. Push your changes to GitHub.

"git add ."
"git commit"
"git push origin"

    5. Open GitHub.

    6. Open Actions. You should see a new workflow up and running.

You can also check details of workflow:

    7. Check your mobile phone for message:

That’s it. You successfully implemented SMS alerts for repository changes.