Skip to content

Commit b49abb7

Browse files
committed
Documented inputs and outputs
1 parent 7300146 commit b49abb7

File tree

1 file changed

+40
-15
lines changed

1 file changed

+40
-15
lines changed

README.md

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,42 @@ Trigger Github Action workflows, and optionally wait for the result.
44

55
## Usage
66

7+
### Inputs
8+
9+
| Name | Description | Required | Default |
10+
| ------------ | -------------------------------------------------- | -------- | ------------------ |
11+
| inputs | JSON object of inputs | No | {} |
12+
| marker-input | Name of the downstream's input for upstream URL. | No | |
13+
| owner | Repsitory owner name | No | Current owner |
14+
| ref | Git reference | No | Current ref |
15+
| repo | Repository name | No | Current repository |
16+
| token | Personal access token | Yes | |
17+
| wait | Whether to wait for conclusion | No | false |
18+
| workflow | Workflow path in .github/workflows (e.g. main.yml) | Yes |
19+
20+
### Outputs
21+
22+
| Name | Description |
23+
| ---------- | ------------------------------------ |
24+
| conclusion | Workflow conclusion, if wait is true |
25+
| run_id | Workflow run ID |
26+
27+
### Marker step
28+
29+
The Github API does not provide a direct association between a workflow dispatch
30+
and the subsequent workflow run. For greater robustness in determining the
31+
relationship, the upstream URL can be used as an input. _The downstream workflow
32+
must use that value as the name of a step._ (See [example](#marker-step-1).)
33+
34+
### Personal access token
35+
36+
A personal access token is required with read/write permissions for actions on
37+
the downstream repo. (Note: The default `GITHUB_TOKEN` does not have sufficient
38+
permissions.) See
39+
[Creating a personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
40+
41+
## Examples
42+
743
### Basic
844

945
**upstream.yml**
@@ -15,11 +51,10 @@ job:
1551
- use: pauldraper/workflow-dispatch@v1.1
1652
with:
1753
inputs: '{"color": "blue"}'
18-
owner: example # defaults to current owner
19-
ref: refs/head/main # defaults to current ref
20-
repo: example # defaults to current repo
21-
token: "${{ secrets.GH_TOKEN }}" # personal access token with actions read/write
22-
wait: true # defaults to false
54+
owner: example
55+
ref: refs/head/main
56+
repo: example
57+
token: "${{ secrets.GH_TOKEN }}"
2358
workflow: downstream.yml
2459
```
2560
@@ -31,12 +66,6 @@ on: [workflow_dispatch]
3166
3267
### Marker Step
3368
34-
The Github API does not provide a direct association between a workflow dispatch
35-
and the workflow run. Workflow Dispatch Plus infers the relationship.
36-
37-
For greater robustness, it can pass the URL of the upstream run to the
38-
downstream run.
39-
4069
**upstream.yml**
4170
4271
```yml
@@ -66,7 +95,3 @@ on:
6695
upstream-url:
6796
description: URL of upstream run
6897
```
69-
70-
### Outputs
71-
72-
The step outputs `run_id` and `conclusion`.

0 commit comments

Comments
 (0)