Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
5.2K

pagerduty-alert pagerduty-alert

Sends Alerts (Incidents or Change Events) to PagerDuty API

arguments

  • API_TOKEN - Either User API Token or Routing Key for Change Event Service depending on PAGERDUTY_ALERT type
  • ASSIGNEE_USER_ID - Optional for incident type when an escalation policy is in place, PagerDuty User ID
  • EVENT_SOURCE - Source of Change Event
  • EVENT_SUMMARY - Summary of Change Event
  • FROM_EMAIL - Required for incident type, PagerDuty User Email
  • PAGERDUTY_ALERT_TYPE - Alert type to send to PagerDuty
  • SERVICE_ID - ID of Service for Incident
  • TITLE - Title of Incident
    CreateIncident:
  type: pagerduty-alert
  arguments:
    API_TOKEN: x2392fhhgdys867gt3fd
    PAGERDUTY_ALERT_TYPE: incident
    ASSIGNEE_USER_ID: PONU62J
    FROM_EMAIL: dustin@codefresh.io
    TITLE: 'Codefresh Build Failed: ${{CF_BUILD_URL}}'
    SERVICE_ID: 87hsd2fh38gh7g

  
    SubmitChangeEvent:
  type: pagerduty-alert
  arguments:
    API_TOKEN: x2392fhhgdys867gt3fd
    PAGERDUTY_ALERT_TYPE: change_event
    EVENT_SOURCE: Codefresh
    EVENT_SUMMARY: Deployment Completed

  
github.com
Dustin Van Buskirk
Apr 14, 2022