Use this action to dispatch multiple workflows in the CloudBees platform.
All CloudBees action repositories are listed at CloudBees, Inc. on GitHub. |
Prerequisites
-
You must generate a personal access token in the CloudBees platform before invoking this action.
-
All workflows to be dispatched must be manually triggered workflows.
Inputs
YAML file specifications
The following inputs are for the YAML file:
Input name | Data type | Required | Description |
---|---|---|---|
|
String |
Yes |
Path to the JSON file containing workflow dispatch requests. |
|
String |
Yes |
Authorization token to authenticate workflow dispatch requests. CloudBees recommends that you pass the token as a secret reference to ensure security. |
|
String |
No |
Whether to dispatch all the workflows in parallel or sequentially. Supported values: 'parallel' (default) or 'serial'. |
|
Boolean |
No |
Whether to wait for workflow executions to complete.
Defaults to false when |
JSON file specifications
The following inputs are for the JSON file:
Field | Data type | Required | Description |
---|---|---|---|
|
String |
Yes |
|
|
String |
Yes |
The branch name containing the workflow to dispatch. |
|
String |
Yes |
The name of the workflow file to dispatch. |
|
Object |
No |
Input parameters to be passed to dispatch the workflow. Represented as key-value pairs, where keys and values are both strings. |
|
Boolean |
No |
Whether to ignore workflow trigger or execution failures.
Default is false.
When both |
Locate the component ID in your browser address bar, displayed as
|
Usage examples
The following summarizes the expected results of using different YAML and JSON specifications in this action.
When the following inputs are specified: | The following results are observed: | |
---|---|---|
|
|
|
|
|
The action triggers all workflows in parallel.
Once triggered, the action step passes regardless of any failures.
The |
|
|
The action triggers all workflows in parallel, and waits for all triggered runs to complete. If all runs are successful, the action step passes. If a dispatched workflow fails in being triggered or executed and has:
|
|
|
The action triggers each workflow sequentially, so as soon as a workflow run is complete, the next workflow is triggered to execute. If all runs are successful, the action step passes. If a dispatched workflow fails in being triggered or executed and has:
|
[1] The wait-for-completion
parameter is always considered true when execution-mode: serial
is set.
Usage example: Default settings
The following example uses the default settings (execution mode: parallel
, wait-for-completion: false
).
- name: Dispatch workflows uses: https://github.com/cloudbees-io/workflows-dispatch@v1 with: workflows-dispatch-file: dispatch_requests.json token: "${{ secrets.TOKEN }}"
The dispatch_requests.json
file for the YAML file above:
Usage example: Await completion of workflow execution
The following action example executes workflows in parallel and waits for completion of all:
- name: Dispatch workflows and wait for completion uses: https://github.com/cloudbees-io/workflows-dispatch@v1 with: workflows-dispatch-file: dispatch_requests.json token: "${{ secrets.TOKEN }}" execution-mode: "parallel" wait-for-completion: true
The dispatch_requests.json
file for the example above:
Usage example: Ignore workflow execution failures
The following action example executes workflows sequentially and ignores failures for one but not the other workflow:
- name: Dispatch workflows sequentially and ignore failures uses: https://github.com/cloudbees-io/workflows-dispatch@v1 with: workflows-dispatch-file: dispatch_requests.json token: "${{ secrets.TOKEN }}" execution-mode: "serial"
The dispatch_requests.json
file for the action example above:
In the example above, workflow-2 is executed regardless if workflow-1 execution has failed, and if workflow-2 is completed successfully, the action step is passed. If workflow-2 fails, the action step is failed.