From 0932cde5e4257cf1dec665048a3703f573df4118 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Sat, 1 Mar 2025 10:04:21 +0100 Subject: [PATCH 1/2] Create sync-dev-to-vX.Y-dev.yaml --- .github/workflows/sync-dev-to-vX.Y-dev.yaml | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/sync-dev-to-vX.Y-dev.yaml diff --git a/.github/workflows/sync-dev-to-vX.Y-dev.yaml b/.github/workflows/sync-dev-to-vX.Y-dev.yaml new file mode 100644 index 0000000000..82f5759e35 --- /dev/null +++ b/.github/workflows/sync-dev-to-vX.Y-dev.yaml @@ -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 From ac04d8fbd3be54edb622a99b8f096e1b09a2533c Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Thu, 6 Mar 2025 17:07:04 +0100 Subject: [PATCH 2/2] Document new workflow --- CONTRIBUTING.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 436eb731d4..f7b8200a44 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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