Skip to content

main: new workflow that syncs dev to vX.Y-dev #4398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025
Merged
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
45 changes: 45 additions & 0 deletions .github/workflows/sync-dev-to-vX.Y-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: sync-dev-to-vX.Y-dev

# author: @ralfhandl

#
# This workflow creates PRs to update the vX.Y-dev branch with the latest changes from dev
#

# run this on push to dev
on:
push:
branches:
- dev

jobs:
sync-branches:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create pull requests
id: pull_requests
shell: bash
run: |
DEV_BRANCHES=$(git branch -r --list origin/v?.?-dev)
for DEV_BRANCH in $DEV_BRANCHES; do
BASE=${DEV_BRANCH:7}
EXISTS=$(gh pr list --base $BASE --head $HEAD \
--json number --jq '.[] | .number')
if [ ! -z "$EXISTS" ]; then
echo "PR #$EXISTS already wants to merge $HEAD into $BASE"
continue
fi

gh pr create --base $BASE --head $HEAD \
--label "Housekeeping" \
--title "$BASE: update from $HEAD" \
--body "Merge \`$HEAD\` into \`$BASE\`."
done
env:
GH_TOKEN: ${{ github.token }}
HEAD: dev
8 changes: 5 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,11 @@ gitGraph TB:
To keep changes in sync, we have some GitHub actions that open pull requests to take changes from `main` onto the `dev` branch, and from `dev` to each active version branch.

- `sync-main-to-dev` opens a pull request with all the changes from the `main` branch that aren't yet included on `dev`.
This needs a single approval from either maintainers or TSC and can be merged.
The aim is to bring build script and repository documentation changes to the other branches.
Published versions of the specifications and schemas will also move across branches with this approach.
- `sync-dev-to-vX.Y-dev` opens pull requests with all the changes from `dev` that aren't yet included on the corresponding `vX.Y-dev` branch.

These need a single approval from either maintainers or TSC and can be merged.
The aim is to bring build script and repository documentation changes to the other branches.
Published versions of the specifications and schemas will also move across branches with this approach.

## Appendix: Issue Automation

Expand Down