diff --git a/README.md b/README.md index 6ea908c..31e7d5e 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ More documentation is available [here](https://developer.pagerduty.com/docs/even **Optional:** a custom summary for your PagerDuty alert +`incident-severity` + +**Optional:** the severity of the incident + `incident-region` **Optional:** the region where the incident occurred @@ -43,4 +47,4 @@ In your `steps`: with: pagerduty-integration-key: '${{ secrets.PAGERDUTY_INTEGRATION_KEY }}' pagerduty-dedup-key: github_workflow_failed -``` \ No newline at end of file +``` diff --git a/action.yml b/action.yml index 71ba43e..a4de594 100644 --- a/action.yml +++ b/action.yml @@ -7,6 +7,9 @@ inputs: pagerduty-dedup-key: description: 'The key used to correlate PagerDuty triggers, acknowledges, and resolves for the same alert.' required: false + incident-severity: + description: 'The severity of the incident occured' + required: false incident-summary: description: 'A custom summary for your PagerDuty alert' required: false diff --git a/index.js b/index.js index 83aab05..713cc6e 100644 --- a/index.js +++ b/index.js @@ -37,6 +37,11 @@ async function sendAlert(alert) { event_action: 'trigger', }; + const customSeverity = core.getInput('incident-severity'); + if (customSeverity != '') { + alert.payload.severity = customSeverity; + } + const customSummary = core.getInput('incident-summary'); if (customSummary != '') { alert.payload.summary = customSummary;