From bd18e399f67fe3281df5c8c5234b6fd65cbfe457 Mon Sep 17 00:00:00 2001 From: Nick Aristizabal Date: Mon, 8 Jul 2024 15:04:06 -0400 Subject: [PATCH 1/2] Added custom severity option to an alert --- action.yml | 3 +++ index.js | 5 +++++ 2 files changed, 8 insertions(+) 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; From 58aff4aba95fc9b812b8b31830d9e7841543670d Mon Sep 17 00:00:00 2001 From: Nick Aristizabal <99772297+NickAwrist@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:10:47 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 +```