The auto-merge
reusable action is located at .github/actions/auto-merge.yml
.
This workflow auto merges pull requests. To use it you will need a Personal Access Token with the following scopes:
repo
for private repositoriespublic_repo
for public repositories
NOTE: This action will auto merge only those pull requests that were opened by Dependabot.
In the repository that will call this action, you need to define a secret named GH_TOKEN
with the value of your Personal Access Token.
This reusable action depends on the following actions:
Specify the target repository this action should run on. This is used to prevent actions from running on repositories other than the target repository. For example, specifying a target-repo
of mdn/workflows
will prevent the workflow from running on forks of mdn/workflows
.
- This
input
is required
The action has the following optional inputs:
Automatically approve pull-requests.
- This
input
is optional with a default oftrue
.
The command to pass to Dependabot.
- This
input
is optional with a default ofsquash and merge
.
The version comparison target. One off major, minor, or patch.
- This
input
is optional with a default ofminor
.
In the repository that will call this action, you will need to add a .github/workflows/auto-merge.yml
file with the following content:
name: "auto-merge"
on: [pull_request_target]
jobs:
auto-merge:
uses: mdn/workflows/.github/workflows/auto-merge.yml@main
with:
target-repo: "mdn/workflows"
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
name: "auto-merge"
on: [pull_request_target]
jobs:
auto-merge:
uses: mdn/workflows/.github/workflows/auto-merge.yml@main
with:
auto-approve: false
target-repo: "mdn/workflows"
secrets:
GH_TOKEN: ${{ secrets.GH_TOKEN }}