-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4572098
Showing
1,881 changed files
with
1,147,722 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
on: | ||
[pull_request] | ||
|
||
name: Check | ||
|
||
jobs: | ||
check: | ||
name: Run Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Run tests | ||
run: | | ||
npm ci | ||
npm run test |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
name: Package | ||
|
||
jobs: | ||
check: | ||
name: Package distribution file | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
- name: Package | ||
run: | | ||
npm ci | ||
npm run test | ||
- name: Commit | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git add dist/ | ||
git add node_modules/ | ||
git commit -m "chore: Update dist" || echo "No changes to commit" | ||
git push origin HEAD:master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Twilio SMS GitHub Action | ||
|
||
Send an SMS from GitHub Actions. | ||
|
||
## Prerequisites | ||
|
||
- A AWS Account. [Sign up for free](https://aws.amazon.com) | ||
- A [A AmazonSNS User](https://aws.amazon.com/pt/iam/) | ||
|
||
## Usage | ||
|
||
1. Set up your credentials as secrets in your repository settings using `AWS_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `FROM_PHONE_NUMBER`, `SMS_TEXT_CONTENT` | ||
|
||
2. Add the following to your workflow | ||
|
||
```yml | ||
- name: "Sending SMS Notification" | ||
uses: twilio-labs/actions-sms@v1 | ||
with: | ||
FROM_PHONE_NUMBER: "+5561123456789" | ||
SMS_TEXT_CONTENT: "Hello from AWS SNS" | ||
env: | ||
AWS_REGION: ${{ secrets.AWS_REGION }} | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
``` | ||
## Inputs | ||
### `FROM_PHONE_NUMBER` | ||
|
||
**Required** Phone number to send the SMS to | ||
|
||
### `SMS_TEXT_CONTENT` | ||
|
||
**Required** The message you want to send | ||
|
||
### `AWS_REGION` | ||
|
||
A AWS Region. Can alternatively be stored in environment | ||
|
||
### `AWS_ACCESS_KEY_ID` | ||
|
||
A AWS Access Key ID. Can alternatively be stored in environment | ||
|
||
### `TWILIO_API_SECRET` | ||
|
||
A Twilio API Secret. Can alternatively be stored in environment | ||
|
||
## Outputs | ||
|
||
### `messageSid` | ||
|
||
The SID of the [message resource](https://www.twilio.com/docs/sms/api/message-resource#message-properties) associated with the SMS sent. | ||
|
||
## Contributing | ||
|
||
## Third Party Licenses | ||
|
||
This GitHub Action uses a couple of Node.js modules to work. | ||
|
||
License and other copyright information for each module are included in the release branch of each action version under `node_modules/{module}`. | ||
|
||
More information for each package can be found at `https://www.npmjs.com/package/{package}` | ||
|
||
## License | ||
|
||
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: "AWS SNS" | ||
author: "rafaelvicio" | ||
description: "Send an SMS from GitHub Actions using AWS SNS" | ||
inputs: | ||
FROM_PHONE_NUMBER: | ||
description: "Phone number to send the SMS to" | ||
required: true | ||
SMS_TEXT_CONTENT: | ||
description: "The message you want to send" | ||
required: true | ||
AWS_REGION: | ||
description: "A AWSN SNS Region. Can alternatively be stored in environment" | ||
required: true | ||
AWS_ACCESS_KEY_ID: | ||
description: "A AWS SNS Key. Can alternatively be stored in environment" | ||
required: true | ||
AWS_SECRET_ACCESS_KEY: | ||
description: "A AWS SNS Secret. Can alternatively be stored in environment" | ||
required: true | ||
outputs: | ||
messageID: | ||
description: "The AWS SNS Message ID" | ||
runs: | ||
using: "node12" | ||
main: "dist/index.js" | ||
branding: | ||
color: "orange" | ||
icon: "message-circle" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _core = require('@actions/core'); var _core2 = _interopRequireDefault(_core); | ||
var _awssdk = require('aws-sdk'); var _awssdk2 = _interopRequireDefault(_awssdk); | ||
// import github from "@actions/github"; | ||
|
||
_awssdk2.default.config.update({ | ||
region: "us-east-1", | ||
accessKeyId: "AKIAQHRRSO6JTAOIFSH6", | ||
secretAccessKey: "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" | ||
}); | ||
|
||
//AKIAQHRRSO6JTAOIFSH6 | ||
//8ud7NHsYDGdl9b8NAght2Bc2SyM01MoQt/fA0z4L | ||
|
||
async function run() { | ||
const params = { | ||
Message: "Esse é um teste" /* required */, | ||
PhoneNumber: "+5561981359421" | ||
}; | ||
|
||
const publishTextPromise = new _awssdk2.default.SNS({ apiVersion: "2010-03-31" }) | ||
.publish(params) | ||
.promise(); | ||
|
||
publishTextPromise | ||
.then(function(data) { | ||
console.log("MessageID is " + data.MessageId); | ||
}) | ||
.catch(function(err) { | ||
console.error(err, err.stack); | ||
}); | ||
} | ||
|
||
async function execute() { | ||
try { | ||
return await run(); | ||
} catch (error) { | ||
_core2.default.error("Failed to send message", message); | ||
_core2.default.setFailed(message); | ||
} | ||
} | ||
|
||
exports. default = execute; | ||
|
||
execute(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.