Skip to content

Commit

Permalink
Merge branch 'main' into pageheader-sign-off-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
broccolinisoup committed Oct 9, 2023
2 parents 4b5ae28 + ac700f6 commit cfd647c
Show file tree
Hide file tree
Showing 219 changed files with 4,555 additions and 2,878 deletions.
7 changes: 0 additions & 7 deletions .changeset/brown-seahorses-melt.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/cuddly-rice-press.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/friendly-shirts-protect.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/happy-rivers-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@primer/react": minor
---

Updates link styles to support underline link preferences.

<!-- Changed components: ActionList, BranchName, Breadcrumbs, Button, Button2, Heading, Link -->
7 changes: 0 additions & 7 deletions .changeset/nasty-jobs-itch.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/polite-hairs-switch.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/tough-pillows-glow.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/two-seals-prove.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/wild-snakes-talk.md

This file was deleted.

93 changes: 93 additions & 0 deletions .github/actions/pagerduty/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: 'PagerDuty Schedule'
description: 'Get information about the given PagerDuty Schedule'
inputs:
schedule-id:
description: 'The id of the schedule'
required: true
token:
description: 'The API token used for making requests to PagerDuty'
required: true
outputs:
user:
description: 'The user who is on call for the final schedule'
value: ${{ steps.pagerduty.outputs.user }}
start:
description: 'The start date for the final schedule'
value: ${{ steps.pagerduty.outputs.start }}
end:
description: 'The end date for the final schedule'
value: ${{ steps.pagerduty.outputs.end }}
id:
description: 'The id for the final schedule'
value: ${{ steps.pagerduty.outputs.id }}
previous-schedule-start:
description: 'The start date for the previous final schedule'
value: ${{ steps.pagerduty.outputs.previous-schedule-start }}
previous-schedule-end:
description: 'The end date for the previous final schedule'
value: ${{ steps.pagerduty.outputs.previous-schedule-end }}
previous-schedule-id:
description: 'The id for the previous final schedule'
value: ${{ steps.pagerduty.outputs.previous-schedule-id }}
previous-schedule-user:
description: 'The individual on call for the previous final schedule'
value: ${{ steps.pagerduty.outputs.previous-schedule-user }}
runs:
using: 'composite'
steps:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Get PagerDuty Schedule
id: pagerduty
uses: actions/github-script@v6
with:
script: |
const { PAGERDUTY_API_KEY } = process.env;
const today = new Date()
// Get current schedule
const schedule = await getSchedule(today);
core.setOutput('user', schedule.user.summary);
core.setOutput('start', schedule.start);
core.setOutput('end', schedule.end);
core.setOutput('id', schedule.id);
const previousScheduleEnd = new Date(schedule.start);
previousScheduleEnd.setDate(previousScheduleEnd.getDate() - 1);
// Get previous schedule
const previousSchedule = await getSchedule(previousScheduleEnd);
core.setOutput('previous-schedule-start', previousSchedule.start);
core.setOutput('previous-schedule-end', previousSchedule.end);
core.setOutput('previous-schedule-id', previousSchedule.id);
core.setOutput('previous-schedule-user', previousSchedule.user.summary);
// Get a schedule
// @see https://developer.pagerduty.com/api-reference/3f03afb2c84a4-get-a-schedule
async function getSchedule(date) {
const url = new URL('https://api.pagerduty.com/schedules/${{ inputs.schedule-id }}')
url.searchParams.append('since', date.toISOString())
url.searchParams.append('until', date.toISOString())
const response = await fetch(url, {
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Token token=${{ inputs.token }}',
},
})
const data = await response.json()
if (!data.schedule) {
throw new Error('Unable to get schedule for id: ${{ inputs.schedule-id }}')
}
const [schedule] = data.schedule.final_schedule.rendered_schedule_entries
return schedule;
}
35 changes: 31 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
Describe your changes here.
<!-- Provide the GitHub issue that this issue closes. Start typing the number or name of the issue after the # below. -->

Closes # (type the issue number after # if applicable; otherwise remove this line)
Closes #

### Screenshots
<!-- Provide an overview of the changes, including before/after screenshots, videos, or graphs when helpful -->

Please provide before/after screenshots for any visual changes
### Changelog

<!-- Under the headings below, list out relevant API changes that this Pull Request introduces -->

#### New

<!-- List of things added in this PR -->

#### Changed

<!-- List of things changed in this PR -->

#### Removed

<!-- List of things removed in this PR -->

### Rollout strategy

<!-- How do you recommend this change to be rolled out? Refer to [contributor docs on Versioning](https://github.com/primer/react/blob/main/contributor-docs/versioning.md) for details. -->

- [ ] Patch release
- [ ] Minor release
- [ ] Major release; if selected, include a written rollout or migration plan

### Testing & Reviewing

<!-- Describe any specific details to help reviewers test or review this Pull Request -->

### Merge checklist

- [ ] Added/updated tests
- [ ] Added/updated documentation
- [ ] Added/updated previews (Storybook)
- [ ] Changes are [SSR compatible](https://github.com/primer/react/blob/main/contributor-docs/CONTRIBUTING.md#ssr-compatibility)
- [ ] Tested in Chrome
- [ ] Tested in Firefox
Expand Down
Loading

0 comments on commit cfd647c

Please sign in to comment.