Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

For a full diff see [`1.6.0...main`][1.6.0...main].

### Added

- Added composite actions `oh-dear/check/request-run` for requesting a check run on [ohdear.app](https://ohdear.app) ([#124]), by [@localheinz]

## [`1.6.0`][1.6.0]

For a full diff see [`1.5.1...1.6.0`][1.5.1...1.6.0].
Expand Down Expand Up @@ -154,5 +158,6 @@ For a full diff see [`1.0.0...main`][1.0.0...main].
[#87]: https://github.com/ergebnis/.github/pull/87
[#96]: https://github.com/ergebnis/.github/pull/96
[#123]: https://github.com/ergebnis/.github/pull/123
[#124]: https://github.com/ergebnis/.github/pull/124

[@localheinz]: https://github.com/localheinz
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This repository provides the following composite actions:
- [`ergebnis/.github/actions/github/pull-request/merge`](#github-pull-request-merge)
- [`ergebnis/.github/actions/github/pull-request/request-review`](#github-pull-request-review)
- [`ergebnis/.github/actions/github/release/create`](#github-release-create)
- [`ergebnis/.github/actions/oh-dear/check/request-run`](#oh-dear-check-request-run)
- [`ergebnis/.github/actions/oh-dear/maintenance-period/start`](#oh-dear-maintenance-period-start)
- [`ergebnis/.github/actions/oh-dear/maintenance-period/stop`](#oh-dear-maintenance-period-stop)

Expand Down Expand Up @@ -516,6 +517,52 @@ none

A release is created by the user who owns the GitHub token specified with the `github-token` input.

### <a name="oh-dear-check-request-run"> `ergebnis/.github/actions/oh-dear/check/request-run`

This action requests a [check](https://ohdear.app/docs/general/checks) run on [Oh Dear!](https://ohdear.app).

```yaml
name: "Deploy"

on:
push:
branches:
- "main"

jobs:
deploy:
name: "Deploy"

runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/[email protected]"
with:
fetch-depth: 50

- name: "Request broken links check on ohdear.app"
uses: "ergebnis/.github/actions/oh-dear/maintenance-period/[email protected]"
with:
oh-dear-api-token: "${{ secrets.OH_DEAR_API_TOKEN }}"
oh-dear-check-id: "${{ secrets.OH_DEAR_BROKEN_LINKS_CHECK_ID }}"
```

For details, see [`actions/oh-dear/check/request-run/action.yaml`](actions/oh-dear/check/request-run/action.yaml).

#### Inputs

- `oh-dear-api-token`, required: The Oh Dear API token of a user with permission to request a check run
- `oh-dear-check-id`, required: Check identifer of an Oh Dear check for which to request a run

#### Outputs

none

#### Side Effects

A check run is requested by the user who owns the Oh Dear API token specified with the `oh-dear-api-token` input for the check identified by the `oh-dear-check-id` input.

### <a name="oh-dear-maintenance-period-start"> `ergebnis/.github/actions/oh-dear/maintenance-period/start`

This action starts a [maintenance period](https://ohdear.app/docs/general/maintenance-windows) on [Oh Dear!](https://ohdear.app).
Expand Down
28 changes: 28 additions & 0 deletions actions/oh-dear/check/request-run/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#inputs
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runs-for-composite-run-steps-actions
# https://ohdear.app/docs/integrations/api/checks#enable-amp-disable-a-check

name: "Request a check run"

description: "Request a check run"

inputs:
oh-dear-api-token:
description: "Oh Dear API token of a user with permission to request a check run"
required: true
oh-dear-check-id:
description: "Check identifer of an Oh Dear check for which to request a run"
required: true

runs:
using: "composite"

steps:
- name: "Request a check run on ohdear.app"
run: |
curl -X POST "https://ohdear.app/api/checks/${{ inputs.oh-dear-check-id }}/request-run" \
-H "Authorization: Bearer ${{ inputs.oh-dear-api-token }}" \
-H "Accept: application/json" \
-H "Content-Type: application/json"
shell: "bash"