Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to query on call for escalation policies #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# PagerDuty On-call Action

A GitHub Action to find the next person on call through PagerDuty.
A GitHub Action to find who is on call through PagerDuty.

## Usage

```yml
name: Find next person on call
name: Find who is on call for a given schedule or escalation policy.
on:
schedule:
- cron: 0 8 * * 1
Expand All @@ -18,8 +18,10 @@ jobs:
uses: mxie/pagerduty-oncall-action@main # replace `main` with release tag
with:
token: ${{ secrets.PAGERDUTY_TOKEN }}
schedule-id: ABCDEFG
- run: echo ${{ steps.pagerduty.outputs.person }} is on call
schedule-id: ABCDEFG # Either set this `schedule-id` or `escalation-policy-id`, not both.
escalation-policy-id: ABCDEFG
- name: Print user who is on call at escalation level 1
run: echo ${{ steps.pagerduty.outputs.person }} is on call
```

See [action.yml](./action.yml) for accepted inputs.
13 changes: 9 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ inputs:
description: "PagerDuty API token"
required: true
schedule-id:
description: "ID of on-call schedule to look up"
required: true
description: "Schedule ID of on-call schedule to look up"
required: false
escalation-policy-id:
description: "Escalation policy ID of on-call schedule to look up"
required: false
start-date:
description: "Start date of on-call to query (in ISO8601)"
required: false
Expand All @@ -15,9 +18,11 @@ inputs:
required: false
outputs:
person:
description: "The person who's on call"
description: "Name of person on call at escalation level 1"
userId:
description: "PagerDuty user ID of person on call at escalation level 1"
runs:
using: "node16"
using: "node20"
main: "dist/index.js"
branding:
icon: "bell"
Expand Down
Loading