From 8aad2d64700ec50ace6ee0c866fccc69220363f2 Mon Sep 17 00:00:00 2001 From: Iyanuoluwa Adebayo Date: Thu, 10 Oct 2024 11:47:52 +0100 Subject: [PATCH 1/2] PORT-10680 Added default action to PagerDuty --- .../pagerduty/.port/resources/actions.json | 61 +++++++++++++++++++ integrations/pagerduty/CHANGELOG.md | 8 +++ integrations/pagerduty/pyproject.toml | 2 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 integrations/pagerduty/.port/resources/actions.json diff --git a/integrations/pagerduty/.port/resources/actions.json b/integrations/pagerduty/.port/resources/actions.json new file mode 100644 index 0000000000..a290b08e14 --- /dev/null +++ b/integrations/pagerduty/.port/resources/actions.json @@ -0,0 +1,61 @@ +[ + { + "identifier": "trigger_incident", + "title": "Trigger incident", + "icon": "pagerduty", + "description": "Trigger a page in PagerDuty that will alert the on-call to an issue", + "trigger": { + "type": "self-service", + "operation": "DAY-2", + "userInputs": { + "properties": { + "title": { + "type": "string", + "title": "Title", + "description": "Title of the incident" + }, + "description": { + "type": "string", + "title": "Description", + "description": "Description of the incident" + } + }, + "required": [], + "order": [ + "title" + ] + }, + "blueprintIdentifier": "pagerdutyService" + }, + "invocationMethod": { + "type": "WEBHOOK", + "url": "https://api.pagerduty.com/incidents", + "agent": false, + "synchronized": true, + "method": "POST", + "headers": { + "RUN_ID": "{{ .run.id }}", + "Authorization": "Token token={{ .secrets.PAGERDUTY_API_TOKEN }}", + "Accept": "application/vnd.pagerduty+json;version=2", + "Content-Type": "application/json", + "From": "{{ .trigger.by.user.email }}" + }, + "body": { + "incident": { + "type": "incident", + "title": "{{ .inputs.title }}", + "service": { + "id": "{{ .entity.identifier }}", + "type": "service_reference" + }, + "urgency": "high", + "body": { + "type": "incident_body", + "details": "{{ .inputs.description }}" + } + } + } + }, + "requiredApproval": false + } +] \ No newline at end of file diff --git a/integrations/pagerduty/CHANGELOG.md b/integrations/pagerduty/CHANGELOG.md index 5b2d2a3019..fe8d99948f 100644 --- a/integrations/pagerduty/CHANGELOG.md +++ b/integrations/pagerduty/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +## 0.1.108 (2024-10-10) + + +### Improvements + +- Added a default Port self service action to allow users to trigger a pagerduty incident alert to on-call users about an issue + + ## 0.1.107 (2024-10-09) diff --git a/integrations/pagerduty/pyproject.toml b/integrations/pagerduty/pyproject.toml index f0fe4748d8..9233a904be 100644 --- a/integrations/pagerduty/pyproject.toml +++ b/integrations/pagerduty/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pagerduty" -version = "0.1.107" +version = "0.1.108" description = "Pagerduty Integration" authors = ["Port Team "] From 8b7022d94b4c3840fa2de3875df4302c000ff5ae Mon Sep 17 00:00:00 2001 From: Iyanuoluwa Adebayo Date: Mon, 14 Oct 2024 10:08:56 +0100 Subject: [PATCH 2/2] Update actions.json --- integrations/pagerduty/.port/resources/actions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integrations/pagerduty/.port/resources/actions.json b/integrations/pagerduty/.port/resources/actions.json index a290b08e14..cd815e5496 100644 --- a/integrations/pagerduty/.port/resources/actions.json +++ b/integrations/pagerduty/.port/resources/actions.json @@ -35,7 +35,7 @@ "method": "POST", "headers": { "RUN_ID": "{{ .run.id }}", - "Authorization": "Token token={{ .secrets.PAGERDUTY_API_TOKEN }}", + "Authorization": "Token token={{ .secrets.pagerduty_token }}", "Accept": "application/vnd.pagerduty+json;version=2", "Content-Type": "application/json", "From": "{{ .trigger.by.user.email }}" @@ -58,4 +58,4 @@ }, "requiredApproval": false } -] \ No newline at end of file +]