https://github.com/eonx-com/actions-opsgenie
Github Actions: OpsGenie Alerting
https://github.com/eonx-com/actions-opsgenie
actions gitops opsgenie
Last synced: 29 days ago
JSON representation
Github Actions: OpsGenie Alerting
- Host: GitHub
- URL: https://github.com/eonx-com/actions-opsgenie
- Owner: eonx-com
- Created: 2019-11-25T23:19:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-25T03:54:19.000Z (about 3 years ago)
- Last Synced: 2025-04-09T06:01:41.458Z (about 1 month ago)
- Topics: actions, gitops, opsgenie
- Language: Shell
- Homepage:
- Size: 17.6 KB
- Stars: 6
- Watchers: 2
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Github Actions: OpsGenie
This Github action can be used to generate alert to OpsGenie by generating a CURL request to the OpsGenie API.
#### Required Parameters
* ALIAS
User defined identifier for the alert (this is used by OpsGenie to de-duplicate alerts)* MESSAGE
The content of the alert message
* PRIORITY
The priority level of the alert (one of the pre-defined OpsGenie levels: P1, P2, P3, P4, P5)
* API_KEYThe OpsGenie API key (this will need to be pre-configured via the OpsGenie website)
#### Optional Parameters
* USE_EU_INSTANCE
Use the EU instance of OpsGenie
#### Example UsageThe following example shows how the action can be used in a Github workflow file. This sends a P5 notification on start
of deployment, and then generates another P5 notification on successful deployment- or a P1 alert on failure```yaml
name: Deploy Production Environmenton:
push:
branches:
- masterjobs:
deploy-production-start:
name: Start Notification
runs-on: ubuntu-latest
steps:
- name: Send OpsGenie Alert
uses: eonx-com/actions-opsgenie@master
with:
API_KEY: ${{ secrets.OPSGENIE_API_KEY }}
PRIORITY: 'P5'
ALIAS: 'deploy-production'
MESSAGE: 'Deployment to production started'deploy-production:
name: Deploy (Production)
runs-on: ubuntu-latest
steps:
...
Deployment logic here
...deploy-production-success:
name: Success Notification
needs: deploy-production
if: success()
runs-on: ubuntu-latest
steps:
- name: Send OpsGenie Alert
uses: eonx-com/actions-opsgenie@master
with:
API_KEY: ${{ secrets.OPSGENIE_API_KEY }}
PRIORITY: 'P5'
ALIAS: 'deploy-production'
MESSAGE: 'Deployment to production completed successfully'deploy-production-failed:
name: Failed Notification
needs: deploy-production
if: failure()
runs-on: ubuntu-latest
steps:
- name: Send OpsGenie Alert
uses: eonx-com/actions-opsgenie@master
with:
API_KEY: ${{ secrets.OPSGENIE_API_KEY }}
PRIORITY: 'P1'
ALIAS: 'deploy-production-failed'
MESSAGE: 'Deployment to production failed. please review Github Actions logs'
```