diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml deleted file mode 100644 index cafc74b..0000000 --- a/.github/workflows/automerge.yml +++ /dev/null @@ -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" diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8386bea..f998832 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 642b15c..f4c87ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/CLAUDE.md b/CLAUDE.md index 5bbb91a..c18798d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -110,11 +110,11 @@ pnpm db:studio # Open Drizzle Studio (DB browser) ### Opening a PR - Create a feature branch: `git checkout -b ` - 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 --json state` before pushing to an existing PR branch.