Deployment
Stage
Adding your Pull Request (PR) branch to the stage branch
- Add "on stage" label to your PR.
- GitHub Bot will attempt to merge your PR branch into the stage branch.
- If a conflict exist between your PR branch and the stage branch you must resolve conflicts by manually. You will need to pull down the stage branch to your development container and merge the PR branch manually (alternatively you will need to reset the stage branch).
- Run
git checkout stage - Run
git merge my-pr-branch-name - Resolve conflicts between your PR branch and the stage branch
- Run
git push origin stage
- Run
Resetting the stage branch
From time to time the stage branch will need to be reset to main. This can happen for any number of reasons including but not limited to:
- Changes to stage branch were never merged to main e.g a PR was merged to stage then closed without merging to main.
- Conflicts were merged differently in stage than in main
Automated reset (recommended)
Use the reset-stage Cursor skill — it automates the entire process and handles merge conflicts automatically.
# Preview what would happen (no changes made)
./tools/scripts/reset-stage.sh
# Perform the actual reset
./tools/scripts/reset-stage.sh --apply
What it does:
- Resets the local
stagebranch tomain - Fetches all open PRs with the
on stagelabel - Merges each one in turn — conflicts are auto-resolved by accepting the incoming PR's changes (
-X theirs) - Force-pushes
stageto origin, triggering the stage deploy workflows - Posts a summary to Slack with a breakdown of merged and auto-resolved PRs
Why -X theirs is safe: Stage is ephemeral — it exists only for integration testing and gets fully replaced on every reset. PR branches are the source of truth and are never modified. The worst outcome is a broken stage build, which is fixed by running the reset again.
In Cursor, you can also trigger this via the skill: type /reset-stage or ask "reset stage".
Manual reset (fallback)
If you need to reset without the script:
- Run
git push -d origin stage - Run
git branch -D stage(This may fail if you don't have a local 'stage' branch) - Run
git checkout main - Run
git pull origin main - Run
git checkout -b stage - Run
git push origin stage - You will then need to merge into stage each PR's currently labelled "on stage" by running
git merge origin/branch-name - Once you've merged all the required branches then run
git push origin stage