GitHub Auto-Merge Rebaser #11205
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires repo secret: PERSONAL_ACCESS_TOKEN with permissions: | |
# Pull Requests: read and write | |
# Workflow: read and write | |
# This effectively creates a merge queue out of all PRs marked as auto-merge, but merge queues are | |
# a GitHub feature is only available to organizations or those on Enterprise Cloud right now. | |
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue | |
name: GitHub Auto-Merge Rebaser | |
on: | |
push: | |
branches: | |
- 'main' | |
- '*feature*' | |
- '**/*feature*' | |
schedule: | |
# Every hour | |
- cron: '0 * * * *' | |
jobs: | |
# NOTE(cemmer): this requires PRs to be auto-merge enabled, so this won't run for Renovate PRs | |
# https://github.com/adRise/update-pr-branch/blob/00f3aa159dd699e5e88ae904a6157eb83c482319/src/lib/github.js#L160-L162 | |
autoupdate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: adRise/[email protected] | |
with: | |
# GitHub won't run workflows off of code commits+pushes from the `github-actions` user | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
base: ${{ github.head_ref || github.ref_name || 'main' }} | |
required_approval_count: 0 | |
require_passed_checks: false | |
# Oldest pull request | |
sort: 'created' | |
direction: 'asc' |