mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-23 00:05:09 +00:00
ci: Auto-merge PRs from fieldmate releases
This commit introduces a GitHub Actions workflow that automatically merges pull requests created by the fieldmate release process. What it does: - Detects PRs from branches starting with `fieldmate-auto-release` - Attempts to enable auto-merge via GitHub CLI - Falls back to direct squash merge if auto-merge is not possible - Uses consistent commit messages and descriptions This ensures that updates to fieldmate in frappe_docker are propagated cleanly and automatically, triggering rebuilds where needed.
This commit is contained in:
parent
8b88d0e06e
commit
867716dc33
1 changed files with 42 additions and 0 deletions
42
.github/workflows/auto-merge-fieldmate.yml
vendored
Normal file
42
.github/workflows/auto-merge-fieldmate.yml
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
name: Auto-merge PRs from fieldmate
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
- reopened
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
automerge:
|
||||
if: startsWith(github.head_ref, 'fieldmate-auto-release')
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Enable auto-merge or fallback merge
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
run: |
|
||||
echo "Trying to enable auto-merge for PR #$PR_NUMBER"
|
||||
|
||||
# Try auto-merge first
|
||||
gh pr merge "$PR_NUMBER" \
|
||||
--squash \
|
||||
--auto \
|
||||
--delete-branch \
|
||||
--body "$COMMIT_BODY" \
|
||||
--subject "$COMMIT_TITLE" || \
|
||||
|
||||
# Fallback: direct squash merge
|
||||
gh pr merge "$PR_NUMBER" \
|
||||
--squash \
|
||||
--delete-branch \
|
||||
--body "$COMMIT_BODY" \
|
||||
--subject "$COMMIT_TITLE"
|
||||
Loading…
Reference in a new issue