GitHub Action
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.
To use the github_actions
action, ensure your workflow includes the
workflow_dispatch
trigger. Additionally, Mergify requires write permissions
on Actions. Navigate to Mergify's UI to accept the permissions necessary for
this action.
Parameters
Key name | Value type | Default | |
---|---|---|---|
workflow | A GitHub Action workflow action | ||
The workflow to act on. |
Workflow Action
Key name | Value type | Default | |
---|---|---|---|
dispatch | A GitHub Actions workflow dispatch | ||
The list of workflows to dispatch via the action. |
Workflow Action Dispatch
Key name | Value type | Default | |
---|---|---|---|
workflow | string | ||
The name of the .yaml GitHub Workflow file with its extension. | |||
inputs | object | ||
The inputs passed to your workflow execution if any. |
Examples
Dispatching GitHub Workflows with Inputs
To dispatch two workflows named hello_world_workflow.yaml
and
foo_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
.
pull_request_rules:- name: Dispatch GitHub Actionsconditions:- label=dispatchactions:github_actions:workflow:dispatch:- workflow: hello_world_workflow.yamlinputs:name: steveage: 42- workflow: foo_workflow.yaml