Merge pull request #84 from trails-cool/merge-queue

Replace automerge action with GitHub merge queue
This commit is contained in:
Ullrich Schäfer 2026-03-26 18:28:23 +00:00 committed by GitHub
commit 14a39dc7cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 64 deletions

View file

@ -1,51 +0,0 @@
name: Automerge
# Triggers:
# - pull_request: fires when PR is opened, labeled, updated, etc.
# Handles the case where the label is added after CI already passed.
# - workflow_run (CI): fires after the CI workflow completes.
# This is needed because check_suite and status events don't reliably
# fire for workflows on the same commit (GitHub prevents infinite loops).
# Without this, the automerge action never retries after CI passes.
on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
workflow_run:
workflows: ["CI"]
types:
- completed
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
automerge:
name: Automerge PR
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v6
- name: Automerge
uses: pascalgn/automerge-action@v0.16.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_LABELS: "automerge"
MERGE_METHOD: "merge"
MERGE_DELETE_BRANCH: "true"
MERGE_READY_STATE: "clean"
UPDATE_METHOD: "rebase"
BASE_BRANCHES: "main"

View file

@ -1,16 +1,11 @@
name: CD
# Triggers:
# - push: normal merges (manual gh pr merge)
# - workflow_run: after automerge completes (GITHUB_TOKEN merges don't trigger push)
# - push: merges via merge queue or manual gh pr merge
# - workflow_dispatch: manual trigger via gh workflow run cd.yml
on:
push:
branches: [main]
workflow_run:
workflows: ["Automerge"]
branches: [main]
types: [completed]
workflow_dispatch: {}
concurrency:
@ -21,7 +16,6 @@ jobs:
build-images:
name: Build & Push Docker Images
runs-on: ubuntu-latest
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
permissions:
contents: read
packages: write

View file

@ -5,6 +5,7 @@ on:
branches: [main]
pull_request:
branches: [main]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@ -22,7 +23,7 @@ jobs:
with:
fetch-depth: 0
- name: Gitleaks
uses: gitleaks/gitleaks-action@v2
uses: trails-cool/gitleaks-action@4cbc857b9cfa2a3297fe2be1078e196d30d1b424
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}

View file

@ -110,11 +110,11 @@ pnpm db:studio # Open Drizzle Studio (DB browser)
### Opening a PR
- Create a feature branch: `git checkout -b <descriptive-name>`
- Keep PRs focused — one logical change per PR
- Add the `automerge` label to auto-merge when CI passes:
- Use the merge queue to auto-merge when CI passes:
```bash
gh pr create --title "..." --body "..." --label automerge
gh pr create --title "..." --body "..."
gh pr merge --merge --auto
```
- PRs with `automerge` label merge and delete the branch automatically
### Stacking PRs (for fast local iteration)
When working on sequential tasks, stack branches locally:
@ -126,8 +126,8 @@ main → feature-a → feature-b → feature-c
- When feature-a merges, rebase feature-b onto main
- This keeps you unblocked while PRs are in CI
### Important: Do not push to a branch after its PR auto-merges
With the `automerge` label, PRs squash-merge as soon as CI passes. If you
### Important: Do not push to a branch after its PR merges via merge queue
Once a PR enters the merge queue it will merge as soon as CI passes. If you
push additional commits to the branch after that, those commits are orphaned
— they won't be on main. Always check `gh pr view <number> --json state`
before pushing to an existing PR branch.