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

feat: add skipped and staled conclusions #129

Merged
merged 2 commits into from
Jul 25, 2023
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
20 changes: 20 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,26 @@ jobs:
action_url: https://example.com/action
details_url: https://example.com/details

test_basic_skipped:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Skipped
conclusion: skipped

test_basic_stale:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Stale
conclusion: stale

# With details
test_with_details:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# GitHub Actions: `checks-action` ![build-test](https://github.com/LouisBrunner/checks-action/workflows/build-test/badge.svg)

Check warning on line 2 in README.md

View workflow job for this annotation

GitHub Actions / Test With Annotations From Run

README.md#L1-L2

Check your spelling for 'banaas'.

Check warning on line 2 in README.md

View workflow job for this annotation

GitHub Actions / Test With Annotations

Spell Checker

Check your spelling for 'banaas'.
Raw output
Do you mean 'bananas' or 'banana'?
This GitHub Action allows you to create [Check Runs](https://developer.github.com/v3/checks/runs/#create-a-check-run) directly from your GitHub Action workflow. While each job of a workflow already creates a Check Run, this Action allows to include `annotations`, `images`, `actions` or any other parameters supported by the [Check Runs API](https://developer.github.com/v3/checks/runs/#parameters).

## Usage
Expand Down Expand Up @@ -53,7 +53,7 @@

### `conclusion`

_Optional_ (**Required** if `status` is `completed`, the default) The conclusion of your check, can be either `success`, `failure`, `neutral`, `cancelled`, `timed_out` or `action_required`
_Optional_ (**Required** if `status` is `completed`, the default) The conclusion of your check, can be either `success`, `failure`, `neutral`, `cancelled`, `timed_out`, `action_required` or `skipped`

### `status`

Expand Down
4 changes: 2 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export const parseInputs = (getInput: GetInput): Inputs.Args => {
if (conclusion) {
conclusion = conclusion.toLowerCase() as Inputs.Conclusion;
if (!Object.values(Inputs.Conclusion).includes(conclusion)) {
if (conclusion.toString() === 'stale') {
throw new Error(`'stale' is a conclusion reserved for GitHub and cannot be set manually`);
}
throw new Error(`invalid value for 'conclusion': '${conclusion}'`);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/namespaces/Inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export enum Conclusion {
Cancelled = 'cancelled',
TimedOut = 'timed_out',
ActionRequired = 'action_required',
Skipped = 'skipped',
}

export enum Status {
Expand Down
Loading