Use this GitHub Action (GHA) in a GHA workflow to trigger a CloudBees platform workflow. For more information, refer to CloudBees platform workflows.
This action is available on the GitHub marketplace.
This action is a Preview feature and is not yet fully supported by CloudBees. |
A Preview feature:
Product features and documentation are frequently updated. If you find an issue or have a suggestion, please contact CloudBees Support. |
Inputs
Input name | Data type | Required? | Description |
---|---|---|---|
|
String |
Yes |
|
|
String |
Yes |
The filename of the CloudBees platform workflow YAML file to be run. |
|
String |
No |
The CloudBees platform URL.
The default value is |
|
String |
No |
The identifier of the CloudBees platform component where the workflow to be run resides. If the caller GHA workflow has been onboarded to the platform, the default is the component ID of where the caller GHA workflow is located.[1] |
|
String |
No |
The repository code branch of the CloudBees platform workflow to be run. The default is the same branch as the triggering GHA workflow. |
|
JSON |
No |
Input parameters required to run the CloudBees platform workflow, formatted as JSON data in key/value pairs. |
[1] This multi-hexadecimal UUID can be found by:
-
Navigating to a component on the CloudBees platform.
-
Locating the ID value in the URL after
componentId=
.
Output
Output name | Data type | Description |
---|---|---|
|
String |
The CloudBees platform 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-gha-cbp/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-gha-cbp/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-gha-cbp/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 platform workflow that prints the cbp-run-url
output from the action.
For more information on the cloudbees-gha-cbp/register-build-artifact@v1
action, refer to the action documentation.