Use this GitHub Action (GHA) in a GHA workflow to trigger a CloudBees Unify workflow. For more information, refer to CloudBees Unify workflows.
This action is available on the GitHub marketplace.
Inputs
| Input name | Data type | Required? | Description |
|---|---|---|---|
|
String |
Yes |
The CloudBees Unify personal access token. |
|
String |
Yes |
The filename of the CloudBees Unify workflow YAML file to be run. |
|
String |
No |
The CloudBees Unify URL.
The default value is |
|
String |
No |
The identifier of the CloudBees Unify component where the workflow to be run resides. If the caller GHA workflow has been onboarded to CloudBees Unify, the default is the component ID of where the caller GHA workflow is located.[1] |
|
String |
No |
The repository code branch of the CloudBees Unify workflow to be run. The default is the same branch as the triggering GHA workflow. |
|
JSON |
No |
Input parameters required to run the CloudBees Unify workflow, formatted as JSON data in key/value pairs. |
[1] This multi-hexadecimal UUID can be found by:
-
Navigating to a component on CloudBees Unify.
-
Locating the ID value in the URL after
componentId=.
Output
| Output name | Data type | Description |
|---|---|---|
|
String |
The CloudBees Unify URL of the triggered CloudBees workflow run. |
Usage examples
Basic example
The following is a basic example of using the action:
steps: - name: Run CloudBees workflow uses: cloudbees-io-gha/run-cloudbees-workflow@v1 with: cloudbees-pat: ${{ secrets.MY_PAT }} workflow-file-name: "workflow.yaml"
Examples using optional inputs
The following example specifies the component ID and the branch name:
steps: - name: Run CloudBees workflow main branch uses: cloudbees-io-gha/run-cloudbees-workflow@v1 with: cloudbees-pat: ${{ secrets.MY_PAT }} workflow-file-name: "workflow.yaml" component-id: "1234abcd-56ef-78gh-90ij-123456klmnop" branch-name: "main"
The following example specifies input parameters:
steps: - name: Run CloudBees workflow main branch uses: cloudbees-io-gha/run-cloudbees-workflow@v1 with: cloudbees-pat: ${{ secrets.MY_PAT }} workflow-file-name: "workflow.yaml" workflow-inputs: '{"workflowInput1": "test1","workflowInput2": "test2"}'
Full workflow and run example
The following GHA workflow example uses this action to run a CloudBees Unify workflow that prints the cbp-run-url output from the action.
For more information on the cloudbees-io-gha/register-build-artifact@v3 action, refer to the action documentation.