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
+28-3Lines changed: 28 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# GitHub Action for Dispatching Workflows
2
2
3
-
This action triggers another GitHub Actions workflow, using the `workflow_dispatch` event.
3
+
This action triggers another GitHub Actions workflow, using the `workflow_dispatch` event.
4
4
The workflow must be configured for this event type e.g. `on: [workflow_dispatch]`
5
5
6
6
This allows you to chain workflows, the classic use case is have a CI build workflow, trigger a CD release/deploy workflow when it completes. Allowing you to maintain separate workflows for CI and CD, and pass data between them as required.
@@ -23,9 +23,17 @@ For details of the `workflow_dispatch` even see [this blog post introducing this
23
23
24
24
> **Required.** A GitHub access token (PAT) with write access to the repo in question.
25
25
>
26
-
> **NOTE.** The automatically provided token e.g. `${{ secrets.GITHUB_TOKEN }}` can not be used, GitHub prevents this token from being able to fire the `workflow_dispatch` and `repository_dispatch` event. [The reasons are explained in the docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token).
26
+
> **NOTE.** The automatically provided token e.g. `${{ secrets.GITHUB_TOKEN }}` can not be used, GitHub prevents this token from being able to fire the `workflow_dispatch` and `repository_dispatch` event. [The reasons are explained in the docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token).
27
27
> The solution is to manually create a PAT and store it as a secret e.g. `${{ secrets.PERSONAL_TOKEN }}`
28
28
29
+
### `app-id`
30
+
31
+
> **Optional.** The GitHub App ID with access to Actions API.
32
+
33
+
### `app-private-key`
34
+
35
+
> **Optional.** The GitHub App Private Key of the app with access to Actions API.
36
+
29
37
### `inputs`
30
38
31
39
> **Optional.** The inputs to pass to the workflow (if any are configured), this must be a JSON encoded string, e.g. `{ "myInput": "foobar" }`.
@@ -101,7 +109,7 @@ For details of the `workflow_dispatch` even see [this blog post introducing this
101
109
102
110
### `workflow-logs`
103
111
104
-
> The logs of the triggered workflow based if `inputs.workflow-logs` is set to either `output`, or `json-output`.
112
+
> The logs of the triggered workflow based if `inputs.workflow-logs` is set to either `output`, or `json-output`.
105
113
> Based on the value, result will be:
106
114
>
107
115
> *`output`: Multiline string
@@ -248,6 +256,23 @@ on:
248
256
required: false
249
257
```
250
258
259
+
### Invoke workflow with app-id and app-private-key
260
+
261
+
```yaml
262
+
- name: Invoke workflow with app-id and app-private-key
Copy file name to clipboardExpand all lines: action.yaml
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,14 @@ inputs:
6
6
description: 'Name or ID of workflow to run'
7
7
required: true
8
8
token:
9
-
description: 'GitHub token with repo write access, can NOT use secrets.GITHUB_TOKEN, see readme'
10
-
required: true
9
+
description: 'GitHub token with repo write access, can NOT use secrets.GITHUB_TOKEN, see README.md. If not provided, app-id and app-private-key must be provided. If token is set it takes precedence over app-id and app-private-key.'
10
+
required: false
11
+
app-id:
12
+
description: 'GitHub App ID with access to Actions API.'
13
+
required: false
14
+
app-private-key:
15
+
description: 'GitHub App Private Key of the app with access to Actions API.'
16
+
required: false
11
17
inputs:
12
18
description: 'Inputs to pass to the workflow, must be a JSON string. All values must be strings (even if used as boolean or number)'
0 commit comments