You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-6Lines changed: 40 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,11 @@ For details of the `workflow_dispatch` even see [this blog post introducing this
11
11
12
12
*Note 2.* If you want to reference the target workflow by ID, you will need to list them with the following REST API call `curl https://api.github.com/repos/{{owner}}/{{repo}}/actions/workflows -H "Authorization: token {{pat-token}}"`
13
13
14
+
_This action is a fork of `benc-uk/workflow-dispatch` to add support for waiting for workflow completion._
15
+
14
16
## Inputs
15
17
### `workflow`
16
-
**Required.** The name or ID of the workflow to trigger and run. This is the name declared in the YAML, not the filename
18
+
**Required.** The name or the filename or ID of the workflow to trigger and run.
17
19
18
20
### `token`
19
21
@@ -30,23 +32,43 @@ The solution is to manually create a PAT and store it as a secret e.g. `${{ secr
30
32
### `repo`
31
33
**Optional.** The default behavior is to trigger workflows in the same repo as the triggering workflow, if you wish to trigger in another GitHub repo "externally", then provide the owner + repo name with slash between them e.g. `microsoft/vscode`
32
34
35
+
### `wait-for-completion`
36
+
**Optional.** If `true`, this action will actively poll the workflow run to get the result of the triggered workflow. It is enabled by default. If the triggered workflow fails due to either `failure`, `timed_out` or `cancelled` then the step that has triggered the other workflow will be marked as failed too.
37
+
38
+
### `wait-for-completion-timeout`
39
+
**Optional.** The time to wait to mark triggered workflow has timed out. The time must be suffixed by the time unit e.g. `10m`. Time unit can be `s` for seconds, `m` for minutes and `h` for hours. It has no effect if `wait-for-completion` is `false`. Default is `1h`
40
+
41
+
### `wait-for-completion-interval`
42
+
**Optional.** The time to wait between two polls for getting run status. The time must be suffixed by the time unit e.g. `10m`. Time unit can be `s` for seconds, `m` for minutes and `h` for hours. It has no effect if `wait-for-completion` is `false`. Default is `30s`.
43
+
**/!\ Do not use a value that is too small to avoid `API Rate limit exceeded`**
33
44
34
45
## Outputs
35
-
None
46
+
### `workflow-conclusion`
47
+
The result of the triggered workflow. May be one of `success`, `failure`, `cancelled`, `timed_out`, `skipped`, `neutral`, `action_required`. The step in your workflow will fail if the triggered workflow completes with `failure`, `cancelled` or `timed_out`. Other workflow conlusion are considered success.
48
+
Only available if `wait-for-completion` is `true`
36
49
37
50
38
51
## Example usage
39
52
```yaml
40
-
- name: Invoke workflow without inputs
41
-
uses: benc-uk/workflow-dispatch@v1
53
+
- name: Invoke workflow without inputs. Wait for result
54
+
uses: aurelien-baudet/workflow-dispatch@v2
42
55
with:
43
56
workflow: My Workflow
44
57
token: ${{ secrets.PERSONAL_TOKEN }}
45
58
```
46
59
60
+
```yaml
61
+
- name: Invoke workflow without inputs. Don't wait for result
62
+
uses: aurelien-baudet/workflow-dispatch@v2
63
+
with:
64
+
workflow: My Workflow
65
+
token: ${{ secrets.PERSONAL_TOKEN }}
66
+
wait-for-completion: false
67
+
```
68
+
47
69
```yaml
48
70
- name: Invoke workflow with inputs
49
-
uses: benc-uk/workflow-dispatch@v1
71
+
uses: aurelien-baudet/workflow-dispatch@v2
50
72
with:
51
73
workflow: Another Workflow
52
74
token: ${{ secrets.PERSONAL_TOKEN }}
@@ -55,10 +77,22 @@ None
55
77
56
78
```yaml
57
79
- name: Invoke workflow in another repo with inputs
0 commit comments