---
title: GitHub Actions
description: Dispatch an existing GitHub workflow in the repository.
---

import ActionOptionsTable from '../../../../components/Tables/ActionOptionsTable';
import OptionsTable from '../../../../components/Tables/OptionsTable';

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.

:::note
  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

<ActionOptionsTable def="GhaActionModel" />

### Workflow Action

<ActionOptionsTable def="GhaActionModelWorkflow" />

### Workflow Action Dispatch

<ActionOptionsTable def="GhaActionModelDispatch" />

## Examples

### Dispatching GitHub Workflows with Inputs

To 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](/configuration/data-types#template) input `author`.

```yaml
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 }}"
```
