Skip to content

Commit fb3e20d

Browse files
committed
doc: Making check results look green
Signed-off-by: Cristian Le <[email protected]>
1 parent 223e4bb commit fb3e20d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ Whether this check decided that the job matrix succeeded.
123123

124124
## Gotchas
125125

126+
### Experimental matrix jobs
127+
126128
An attentive reader may have noticed that there is no clear way to
127129
allow failures for specific job generated by matrixes in a simple
128130
manner, through action inputs. This is due to the fact that those
@@ -174,6 +176,40 @@ jobs:
174176
...
175177
```
176178

179+
### Displaying the overall workflow result
180+
181+
The GitHub commit and pull-request checks will still display as if the workflows
182+
have failed (the red cross on the checks). To clarify the actual status of the
183+
workflow taking into account [experimental matrix jobs] and `allowed-failures`
184+
you can do two things:
185+
186+
#### Display the workflow badge
187+
188+
See the [github documentation][workflow-badge-doc] about how to include the
189+
workflow status on the top-level README page. Simply point this to the workflow
190+
that runs the alls-green action, e.g.:
191+
```markdown
192+
![CI-status](https://github.com/github/docs/actions/workflows/ci.yml/badge.svg?branch=main&event=push)
193+
```
194+
195+
#### Masking the check results
196+
197+
If you know the exact step that may fail, you can use
198+
[`steps[*].continue-on-error`] to mask the job's result, e.g.:
199+
```yaml
200+
jobs:
201+
tests:
202+
runs-on: ubuntu-latest
203+
matrix:
204+
python-version: [ "3.11", "3.x" ]
205+
includes:
206+
- python-version: "3.x"
207+
experimental: true
208+
steps:
209+
- uses: actions/checkout@v5
210+
- runs: do-test
211+
continue-on-error: ${{ github.event_name == 'push' && matrix.experimental}}
212+
```
177213
178214
## Does anybody actually use this?
179215
@@ -210,6 +246,7 @@ The contents of this project is released under the
210246
[BSD 3-clause license].
211247

212248

249+
[`steps[*].continue-on-error`]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
213250
[aiohttp]: https://github.com/aio-libs/aiohttp
214251
[Ansible]: https://github.com/ansible
215252
[Ansible Collections]: https://github.com/ansible-collections
@@ -218,6 +255,7 @@ The contents of this project is released under the
218255
[BSD 3-clause license]: LICENSE.md
219256
[conda]: https://github.com/conda/conda
220257
[coveragepy]: https://github.com/nedbat/coveragepy
258+
[experimental matrix jobs]: #experimental-matrix-jobs
221259
[forum:check]:
222260
https://github.com/orgs/community/discussions/26733#discussioncomment-3253151
223261
[gating]: https://gating.dev
@@ -228,6 +266,7 @@ https://github.com/orgs/community/discussions/26733#discussioncomment-3253151
228266
[spaceship-prompt]: https://github.com/spaceship-prompt/spaceship-prompt
229267
[structlog]: https://github.com/hynek/structlog
230268
[Towncrier]: https://github.com/twisted/towncrier
269+
[workflow-badge-doc]: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge
231270
[Zuul]: https://zuul-ci.org
232271
[@aio-libs]: https://github.com/aio-libs
233272
[@CherryPy]: https://github.com/cherrypy

0 commit comments

Comments
 (0)