Skip to content

Commit 4978a78

Browse files
committed
docs(readme): correct readme source
1 parent 01aee8f commit 4978a78

2 files changed

Lines changed: 79 additions & 30 deletions

File tree

README.md

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,50 @@ wait for all `workflow_run` required workflows to be successful
1010

1111
<details>
1212
<summary><strong>Why?</strong></summary>
13-
14-
The [`workflow_run`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run) event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow.
1513

16-
###### example
17-
```yaml
18-
on:
19-
workflow_run:
20-
workflows: [ test ]
21-
types:
22-
- completed
23-
```
14+
The [`workflow_run`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run) event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow.
15+
16+
###### example
17+
18+
``` yaml
19+
on:
20+
workflow_run:
21+
workflows: [ test ]
22+
types:
23+
- completed
24+
```
25+
26+
However by itself, this doesn't quite work as expected.
27+
28+
1. The `completed` type, does not indicate success, for that you'd have to include the following in each job of your workflow:
29+
30+
``` yaml
31+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
32+
```
33+
34+
2. If you're depending on more than one workflow, then ANY of them completing, will trigger the event
35+
36+
###### example
2437

25-
However by itself, this doesn't quite work as expected.
38+
``` yaml
39+
name: deploy
2640
27-
1. The `completed` type, does not indicate success, for that you'd have to include the following in each job of your workflow:
28-
```yaml
29-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
30-
```
41+
on:
42+
workflow_run:
43+
workflows: [ test, lint, compile ]
44+
types:
45+
- completed
46+
```
3147

32-
2. If you're depending on more than one workflow, then ANY of them completing, will trigger the event
33-
###### example
34-
```yaml
35-
name: deploy
48+
> *if your `test` workflow fails, but `lint` completed successfully, `github.event.workflow_run.conclusion == 'success'` will still be true*
3649

37-
on:
38-
workflow_run:
39-
workflows: [ test, lint, compile ]
40-
types:
41-
- completed
42-
```
43-
> _if your `test` workflow fails, but `lint` completed successfully, `github.event.workflow_run.conclusion == 'success'` will still be true_
50+
3. Your workflow will trigger as many times as you have workflow dependencies
4451

45-
3. Your workflow will trigger as many times as you have workflow dependencies
46-
> _in the previous example, our `deploy` workflow, will run 3 times!_
52+
> *in the previous example, our `deploy` workflow, will run 3 times!*
4753

48-
All this makes the `workflow_run` event fundamentally broken for any advanced usage, this Action aims to remedy that.
54+
All this makes the `workflow_run` event fundamentally broken for any advanced usage, this Action aims to remedy that.
4955

50-
> _**Note**: See this [Community discussion](https://github.community/t/workflow-run-completed-event-triggered-by-failed-workflow/128001/5) for more info on the topic_
56+
> ***Note**: See this [Community discussion](https://github.community/t/workflow-run-completed-event-triggered-by-failed-workflow/128001/5) for more info on the topic*
5157

5258
</details>
5359

docs/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
<details>
2+
<summary><strong>Why?</strong></summary>
3+
4+
The [`workflow_run`](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_run) event occurs when a workflow run is requested or completed, and allows you to execute a workflow based on the finished result of another workflow.
5+
6+
###### example
7+
```yaml
8+
on:
9+
workflow_run:
10+
workflows: [ test ]
11+
types:
12+
- completed
13+
```
14+
15+
However by itself, this doesn't quite work as expected.
16+
17+
1. The `completed` type, does not indicate success, for that you'd have to include the following in each job of your workflow:
18+
```yaml
19+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
20+
```
21+
22+
2. If you're depending on more than one workflow, then ANY of them completing, will trigger the event
23+
###### example
24+
```yaml
25+
name: deploy
26+
27+
on:
28+
workflow_run:
29+
workflows: [ test, lint, compile ]
30+
types:
31+
- completed
32+
```
33+
> _if your `test` workflow fails, but `lint` completed successfully, `github.event.workflow_run.conclusion == 'success'` will still be true_
34+
35+
3. Your workflow will trigger as many times as you have workflow dependencies
36+
> _in the previous example, our `deploy` workflow, will run 3 times!_
37+
38+
All this makes the `workflow_run` event fundamentally broken for any advanced usage, this Action aims to remedy that.
39+
40+
> _**Note**: See this [Community discussion](https://github.community/t/workflow-run-completed-event-triggered-by-failed-workflow/128001/5) for more info on the topic_
41+
42+
</details>
43+
144
## Usage
245

346
```yaml

0 commit comments

Comments
 (0)