Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danushka96/sns-action
Github action to publish message to AWS SNS topic
https://github.com/danushka96/sns-action
Last synced: 17 days ago
JSON representation
Github action to publish message to AWS SNS topic
- Host: GitHub
- URL: https://github.com/danushka96/sns-action
- Owner: Danushka96
- Created: 2021-03-13T10:29:16.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-03-23T07:59:34.000Z (over 3 years ago)
- Last Synced: 2024-10-13T09:44:17.136Z (25 days ago)
- Language: JavaScript
- Size: 801 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SNS github action
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)Github action to publish message to AWS SNS topic
## Usage
1. Create a .github/workflows/sns-notify.yml file in your GitHub repo.
1. Add the following code to the sns-notify.yml file.``` yml
name: SNS-notifyon:
workflow_dispatch:jobs:
build:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v2
- name: SNS action step
uses: Danushka96/sns-action@v2
with:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TOPIC_ARN: ${{ secrets.AWS_TOPIC_ARN }}
MESSAGE: "Build success 1.0.011"
SUCCESS: true
```
3. Create a SNS topic from [AWS console](https://console.aws.amazon.com/sns/v3/home) save the topic ARN in the [Github Secrets](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository)## Environment Variables
| Variable | Default | Purpose |
| -------- | -------- | -------- |
| AWS_REGION | | Region of SNS Topic |
| AWS_ACCESS_KEY_ID | | AWS access key to send message to sns topic |
| AWS_SECRET_ACCESS_KEY | | AWS secret access key to send message to sns topic |
| AWS_REGION | | Region of SNS Topic |
| TOPIC_ARN | | ARN of SNS Topic |
| MESSAGE | | Custom message that can be sent to sns topic |
| SUCCESS |true | Extra parameter to notify success or fail |## Output Message
|Property|Value|
|--------|------|
|githubRef|GITHUB_REF|
|githubEvent|GITHUB_EVENT_NAME|
|githubRepo|GITHUB_REPOSITORY|
|githubSHA|GITHUB_SHA|
|githubActor|GITHUB_ACTOR|
|success|SUCCESS|
|message|MESSAGE|