Compare commits

..

No commits in common. "dc56defea23d932ede30e3ef11b557267a2bfcd3" and "f2f2d4066c01643b1314189bf47a1b6b373b82f1" have entirely different histories.

2 changed files with 44 additions and 38 deletions

44
.github/workflows/auto-merge.yaml vendored Normal file
View file

@ -0,0 +1,44 @@
name: Enable auto-merge
on:
pull_request:
types: [opened, ready_for_review, reopened, synchronize]
branches: [main]
concurrency:
group: enable-auto-merge-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
contents: write
pull-requests: write
jobs:
enable:
if: >-
github.event.pull_request.draft == false
&& github.event.pull_request.head.repo.full_name == github.repository
&& github.event.pull_request.user.login != 'dependabot[bot]'
&& github.event.pull_request.user.login != 'renovate[bot]'
runs-on: ubuntu-latest
steps:
- name: Enable squash auto-merge
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail
if [ "$(gh pr view "$PR" --repo "$REPO" --json autoMergeRequest --jq '.autoMergeRequest != null')" = "true" ]; then
echo "auto-merge already enabled"
exit 0
fi
if ! out=$(gh pr merge "$PR" --repo "$REPO" --auto 2>&1); then
echo "$out"
if [ "$(gh pr view "$PR" --repo "$REPO" --json autoMergeRequest --jq '.autoMergeRequest != null')" = "true" ]; then
echo "auto-merge already enabled"
exit 0
fi
exit 1
fi
printf '%s\n' "$out"

View file

@ -1,38 +0,0 @@
merge_queue:
mode: serial
max_parallel_checks: 1
merge_protections_settings:
auto_merge_conditions:
- base = main
- -draft
- "#approved-reviews-by >= 1"
- github-review-decision = APPROVED
- check-success = "ci / ci"
merge_protections:
- name: require-review-and-ci
if:
- base = main
success_conditions:
- "#approved-reviews-by >= 1"
- github-review-decision = APPROVED
- check-success = "ci / ci"
queue_rules:
- name: default
queue_conditions:
- base = main
- -draft
- "#approved-reviews-by >= 1"
- github-review-decision = APPROVED
- check-success = "ci / ci"
merge_conditions:
- "#approved-reviews-by >= 1"
- github-review-decision = APPROVED
- check-success = "ci / ci"
merge_method: squash
commit_message_format:
title: inherit
body: empty
branch_protection_injection_mode: queue