Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nexmo-community/nexmo-sms-action
Send SMS from GitHub Actions
https://github.com/nexmo-community/nexmo-sms-action
extend nexmo sms
Last synced: 28 days ago
JSON representation
Send SMS from GitHub Actions
- Host: GitHub
- URL: https://github.com/nexmo-community/nexmo-sms-action
- Owner: nexmo-community
- Created: 2018-10-30T21:04:45.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-06-18T11:59:59.000Z (over 1 year ago)
- Last Synced: 2024-10-30T07:47:52.417Z (3 months ago)
- Topics: extend, nexmo, sms
- Language: JavaScript
- Size: 451 KB
- Stars: 14
- Watchers: 14
- Forks: 11
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-actions - Send an SMS from GitHub Actions using Nexmo
- fucking-awesome-actions - Send an SMS from GitHub Actions using Nexmo
- awesome-workflows - Send an SMS from GitHub Actions using Nexmo
README
# Nexmo SMS Action
Send an SMS from [GitHub Actions](https://github.com/features/actions) using [Nexmo](https://www.nexmo.com/).
## Usage
```workflow
name: Push to master
on: [push]
jobs:
send-sms:
name: Send SMS
runs-on: ubuntu-latest
steps:
- name: Send SMS
uses: nexmo-community/nexmo-sms-action@main
env:
NEXMO_API_KEY: ${{ secrets.NEXMO_API_KEY }}
NEXMO_API_SECRET: ${{ secrets.NEXMO_API_SECRET }}
with:
nexmoNumber: ${{ secrets.NEXMO_NUMBER }}
recipientNumber: 14155512345
message: "New push on ${{ github.repository }} from ${{ github.actor }}"
```The example above will send `New push on org-name/repo-name from your_username` to `14155512345`.
If you don't want to expose your recipient number, you can use secrets.
For example, a new secret called `RECIPIENT_NUMBER` could be used inside of `with` as follows:
```workflow
name: Push to master
on: [push]
jobs:
send-sms:
name: Send SMS
runs-on: ubuntu-latest
steps:
- name: Send SMS
uses: nexmo-community/nexmo-sms-action@main
env:
NEXMO_API_KEY: ${{ secrets.NEXMO_API_KEY }}
NEXMO_API_SECRET: ${{ secrets.NEXMO_API_SECRET }}
with:
nexmoNumber: ${{ secrets.NEXMO_NUMBER }}
recipientNumber: ${{ secrets.RECIPIENT_NUMBER }}
message: "New push on ${{ github.repository }} from ${{ github.actor }}"
```## Secrets
This action uses the following required secrets:
- `NEXMO_API_KEY` - Your Nexmo API Key.
- `NEXMO_API_SECRET` - Your Nexmo API Secret.
- `NEXMO_NUMBER` - A number on your Nexmo account without any spaces or symbols. Example: `15551231234`.## Event Information
All of the information attached to an event is available in the `github.event` variable. To see the possible values, you can use the following step in your workflow:
```yaml
- run: echo '${{ toJson(github.event) }}'
```You can use this information in both the inputs for your action and to run the action conditionally.
Here's an example of sending an SMS any time an issue is created with the `urgent` label:
```workflow
name: Issue
on:
issues:
types: [labeled]
jobs:
send-sms:
name: Send SMS
runs-on: ubuntu-latest
steps:
- name: Send SMS
uses: nexmo-community/nexmo-sms-action@main
env:
NEXMO_API_KEY: ${{ secrets.NEXMO_API_KEY }}
NEXMO_API_SECRET: ${{ secrets.NEXMO_API_SECRET }}
with:
nexmoNumber: ${{ secrets.NEXMO_NUMBER }}
recipientNumber: ${{ secrets.RECIPIENT_NUMBER }}
message: "This urgent issue needs your attention: ${{ github.event.issue.html_url }}"
if: github.event.label.name == 'urgent'
```[GitHub Actions]: https://github.com/actions
[Nexmo]: https://developer.nexmo.com
[jq]: https://stedolan.github.io/jq/