Skip to content

Commit

Permalink
feat: add skipped and staled conclusions (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisBrunner authored Jul 25, 2023
1 parent 3f3c4cf commit c6dbaea
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
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
Expand Up @@ -53,7 +53,7 @@ _Optional_ The SHA of the target commit. Defaults to the current commit.

### `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

0 comments on commit c6dbaea

Please sign in to comment.