GitHub Actions
Dispatch an existing GitHub workflow in the repository.
The github_actions
action enables Mergify to seamlessly dispatch existing
GitHub workflows within a repository when specified conditions are satisfied.
By integrating this action, users can optimize their CI/CD pipeline, invoking
specific GitHub Actions based on Mergify’s conditions.
Parameters
Section titled ParametersKey name | Value type |
---|---|
workflow | Workflow Action |
Workflow Action
Section titled Workflow ActionKey name | Value type | |
---|---|---|
dispatch | list of Workflow Action Dispatch | |
The list of workflows to dispatch via the action. |
Workflow Action Dispatch
Section titled Workflow Action DispatchKey name | Value type | |
---|---|---|
inputs | object | |
The inputs passed to your workflow execution if any. Values can be either a template, a number or a Boolean. | ||
ref | string or null | |
The reference to use when triggering the job. If none is passed, the default repository branch is used. | ||
workflow | string | |
The name of the .yaml GitHub Workflow file with its extension. |
Examples
Section titled ExamplesDispatching GitHub Workflows with Inputs
Section titled Dispatching GitHub Workflows with InputsTo dispatch three workflows named foo_workflow.yaml
, hello_world_workflow.yaml
and
dynamic_workflow.yaml
when a pull request is labeled with “dispatch”, use the
following rule.
Here, the hello_world_workflow.yaml
workflow accepts two
inputs, which are defined as name
and age
. The dynamic_workflow.yaml
takes the template input author
.
pull_request_rules:
- name: Dispatch GitHub Actions
conditions:
- label = dispatch
actions:
github_actions:
workflow:
dispatch:
- workflow: foo_workflow.yaml
- workflow: hello_world_workflow.yaml
inputs:
name: steve
age: 42
- workflow: dynamic_workflow.yaml
inputs:
author: "{{ author }}"