@@ -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**
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
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