Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- release/**
pull_request:
merge_group:
types: [checks_requested]
branches: [develop]
workflow_dispatch:
inputs:
commit:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/enforce-license-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ on:
- v10
- v9
- v8
merge_group:
branches: [develop]

jobs:
enforce-license-compliance:
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/gitflow-sync-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
permissions:
pull-requests: write
contents: write
checks: read
statuses: read
steps:
- name: git checkout
uses: actions/checkout@v7
Expand All @@ -44,16 +46,29 @@ jobs:
pr_label: 'Dev: Gitflow'
github_token: ${{ steps.app-token.outputs.token }}

- name: Enable automerge for PR
if: steps.open-pr.outputs.pr_number != ''
run: gh pr merge --merge --auto "${{ steps.open-pr.outputs.pr_number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# https://github.com/marketplace/actions/auto-approve
- name: Auto approve PR
if: steps.open-pr.outputs.pr_number != ''
uses: hmarr/auto-approve-action@v4
with:
pull-request-number: ${{ steps.open-pr.outputs.pr_number }}
review-message: 'Auto approved automated PR'

- name: Wait for checks and merge backmerge
if: steps.open-pr.outputs.pr_number != ''
timeout-minutes: 45
shell: bash
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITFLOW_TOKEN: ${{ steps.app-token.outputs.token }}
PR_NUMBER: ${{ steps.open-pr.outputs.pr_number }}
run: |
backmerge_head=$(gh pr view "$PR_NUMBER" --json headRefOid --jq .headRefOid)

gh pr checks "$PR_NUMBER" --required --watch --fail-fast --interval 30

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checks watch fails before CI starts

High Severity

gh pr checks --required --watch returns an error as soon as the status rollup has no required checks. That is the usual state right after the backmerge PR is opened, so the job exits before CI registers and never reaches the merge.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f7e3e72. Configure here.


GH_TOKEN="$GITFLOW_TOKEN" gh pr merge "$PR_NUMBER" \
--merge \
--admin \
--match-head-commit "$backmerge_head"
13 changes: 12 additions & 1 deletion docs/gitflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ We use [Gitflow](https://docs.github.com/en/get-started/quickstart/github-flow)

![gitflow-chart](./assets/gitflow-chart.png)

PRs into `develop` normally merge through the squash merge queue.
Release backmerges from `master` use merge commits to preserve Git history.
The Gitflow automation waits for required checks, then merges through the
Gitflow App's queue-only bypass. Required checks and approvals still apply.

If the backmerge workflow fails or times out, resolve the blocker and rerun
the failed job.

## Important Caveats

While a release is pending, we may merge anything into develop, **except for changes to package.json files**. If we
Expand All @@ -30,4 +38,7 @@ If this happen, you can resolve this as follows:
- Create a new branch on top of `master` (e.g. `manual-develop-sync`)
- Merge `develop` into this branch, with a merge commit (and fix any merge conflicts that come up)
- Now create a PR against `develop` from your branch (e.g. `manual-develop-sync`)
- Merge this PR with a merge commit
- Wait for required checks and approval on the replacement PR.
- Have a release maintainer with queue-bypass permission merge the PR directly,
choosing **Create a merge commit**. Do not add it to the squash merge queue.
Bypass only the queue requirement; required checks and approvals still apply.
Loading