This orb can be used to trigger a GitHub Actions workflow from CircleCI. The workflow can be triggered and the process will wait until it has completed or it can trigger the workflow and not wait for a response.
In order to trigger a GitHub Action workflow it will require a token so that it can authenticate successfully.
Note that the token must be a project API token and not a personal API token.
This command will trigger the GitHub Actions workflow. It can then either wait until that workflow completes or just trigger it.
Parameters
github_action_token
- The GitHub Actions token to trigger the workflow.repo_name
- The GitHub repository where the workflow can be found.workflow_id
- The GitHub workflow filename.git_branch
- The Git branch that the triggered workflow will use.workflow_parameters
- Double quoted key value pair of any extra parameters that the workflow requires.wait_for_completion
- Defaults to false but if set totrue
it will wait for the workflow to complete.timeout
- (in minutes). This defaults to 10 minutes but can be increased if the workflow being triggered takes longer to complete. This is only used whenwhat_for_completion
is set totrue
.
description: >
Trigger a GitHub Actions pipeline (but do not wait for it to complete).
usage:
version: 2.1
orbs:
github-actions: ovotech/[email protected]
workflows:
gha-workflow:
jobs:
- github-actions/execute_workflow:
github_action_token: $GHA_API_TOKEN
repo_name: team-cppe
workflow_id: trigger-circle.yml
git_branch: main
description: >
Trigger a GitHub Actions pipeline and wait for it to complete.
usage:
version: 2.1
orbs:
github-actions: ovotech/[email protected]
workflows:
gha-workflow:
jobs:
- github-actions/execute_workflow:
github_action_token: $GHA_API_TOKEN
repo_name: team-cppe
workflow_id: trigger-circle.yml
git_branch: main
wait_for_completion: true
description: >
Trigger a GitHub Actions pipeline and wait for it to complete.
usage:
version: 2.1
orbs:
github-actions: ovotech/[email protected]
workflows:
gha-workflow:
jobs:
- github-actions/execute_workflow:
github_action_token: $GHA_API_TOKEN
repo_name: team-cppe
workflow_id: trigger-circle.yml
git_branch: main
workflow_parameters: '{"param_1":"value_1","param_2":"true"}'
wait_for_completion: true
description: >
Downloads an artifact from a GitHub Actions Workflow
usage:
version: 2.1
orbs:
github-actions: ovotech/[email protected]
workflows:
gha-workflow:
jobs:
- github-actions/extract_artifact:
github_action_token: $GHA_API_TOKEN
repo_name: team-cppe
artifact_name: test-artifact