Skip to content

Commit 4b6f23f

Browse files
authored
fix: use "pending" as default value for status (#7)
1 parent fd8a60f commit 4b6f23f

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

.github/workflows/pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
- uses: ./
1111
with:
1212
addHoldComment: "true"
13-
status: "pending"
1413
- run: npm ci
1514
- run: npm run build
1615
- run: npm run format-check
@@ -22,4 +21,5 @@ jobs:
2221
- if: always()
2322
uses: ./
2423
with:
25-
addHoldComment: "true"
24+
addHoldComment: "true"
25+
status: "${{ job.status }}"

README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ GitHub does not update the status of a commit when running workflow and therefor
1414
* token: Auth token used to add status commits
1515

1616
* required
17-
* default: ${ github.token }
17+
* default: "${ github.token }"
1818

1919
* name: The Name of the status check to add to the commit
2020
* required
21-
* default: GithubActions - ${GITHUB_WORKFLOW}
21+
* default: "GithubActions - ${GITHUB_WORKFLOW}"
2222

2323
* status: Commit or job status, based on this the action will set the correct status in the commit: Accepted values are: `error`, `failure`, `pending`, `success` and `cancelled`.
2424

@@ -31,7 +31,7 @@ GitHub does not update the status of a commit when running workflow and therefor
3131
If the passed status is `error` it will set status commit `error`.
3232

3333
* required
34-
* default: ${ job.status }
34+
* default: "pending"
3535

3636
* url: URL for the status check.
3737

@@ -77,14 +77,29 @@ name: Test
7777
7878
on: [pull_request]
7979
80+
jobs:
81+
build:
82+
runs-on: ubuntu-latest
83+
steps:
84+
- uses: actions/checkout@v2
85+
- uses: ouzi-dev/commit-status-updater@v1.0.0
86+
```
87+
88+
### Action sets commit to error status without comment
89+
90+
```
91+
name: Test
92+
93+
on: [pull_request]
94+
8095
jobs:
8196
build:
8297
runs-on: ubuntu-latest
8398
steps:
8499
- uses: actions/checkout@v2
85100
- uses: ouzi-dev/commit-status-updater@v1.0.0
86101
with:
87-
status: "pending"
102+
status: "error"
88103
```
89104

90105
### Action sets commit to pending status with comment, and updates check and adds comment at the end of the workflow
@@ -101,12 +116,12 @@ jobs:
101116
- uses: actions/checkout@v2
102117
- uses: ouzi-dev/commit-status-updater@v1.0.0
103118
with:
104-
status: "pending"
105119
addHoldComment: "true"
106120
- if: always()
107121
uses: ouzi-dev/commit-status-updater@v1.0.0
108122
with:
109123
addHoldComment: "true"
124+
status: "${{ job.status }}"
110125
```
111126

112127
### Action with custom hold comments
@@ -130,7 +145,7 @@ jobs:
130145
failComment: "action failed!"
131146
```
132147

133-
### Action no comments, set commit to "pending" status and set url, description and specific name
148+
### Action no comments, set commit to "error" status and set url, description and specific name
134149

135150
```
136151
name: Test
@@ -144,7 +159,7 @@ jobs:
144159
- uses: actions/checkout@v2
145160
- uses: ouzi-dev/commit-status-updater@v1.0.0
146161
with:
147-
status: "pending"
162+
status: "error"
148163
url: http://myurl.io/
149164
description: "this is my status check"
150165
name: "name of my status check"

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ inputs:
3232
If the passed status is 'failure' or 'cancelled' it wil set status commit 'failure'
3333
If the passed status is 'success' it will set status commit 'success'
3434
If the passed status is 'error' it will set status commit 'error'
35-
default: "${{ job.status }}"
35+
default: "pending"
3636
required: true
3737
ignoreForks:
3838
description: >

0 commit comments

Comments
 (0)