Auto-merge
Letting qualifying updates merge without a human in the loop.
Merge strategies by update type, the available merge methods, and the branch protection GitHub requires before auto-merge can be enabled.
How it works
With auto-merge enabled, the action turns on GitHub’s auto-merge on the pull requests that match the configured strategy. Those pull requests merge once the required status checks pass and the branch protection rules are satisfied.
Important
Auto-merge requires at least one required status check or branch protection rule on the base branch. Without one, GitHub refuses to enable auto-merge.
Strategies
auto-merge-strategy decides which updates qualify:
patch(default) merges patch updates only, for example1.0.0to1.0.1.minormerges minor and patch updates, for example1.0.0to1.1.0.allmerges every update, including major versions.
Methods
auto-merge-method decides how the merge is performed:
squash(default) squashes the commits into one.mergecreates a merge commit.rebaserebases and merges.
Permissions
The workflow needs write access to pull requests:
permissions:
contents: write
pull-requests: writeExamples
Auto-merge patch updates:
name: Update Quarto Extensions
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: "release"
- uses: mcanouil/quarto-extensions-updater@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-merge: true
auto-merge-strategy: "patch"
auto-merge-method: "squash"Auto-merge minor and patch updates:
- uses: mcanouil/quarto-extensions-updater@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-merge: true
auto-merge-strategy: "minor"Notes
- A pull request only merges once all required status checks pass.
- When auto-merge cannot be enabled, for example because of missing permissions or missing status checks, the pull request is still created without it.
- The action logs a warning in that case and carries on with the rest of the run.
- With grouped updates, auto-merge is enabled only when every update in the group qualifies.