Skip to content

Commit 79ff798

Browse files
authored
Merge pull request #4398 from OAI/main-workflow-sync-dev-to-vX.Y-dev
main: new workflow that syncs dev to vX.Y-dev
2 parents bc7aaf3 + ac04d8f commit 79ff798

File tree

2 files changed

+50
-3
lines changed

2 files changed

+50
-3
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: sync-dev-to-vX.Y-dev
2+
3+
# author: @ralfhandl
4+
5+
#
6+
# This workflow creates PRs to update the vX.Y-dev branch with the latest changes from dev
7+
#
8+
9+
# run this on push to dev
10+
on:
11+
push:
12+
branches:
13+
- dev
14+
15+
jobs:
16+
sync-branches:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Create pull requests
25+
id: pull_requests
26+
shell: bash
27+
run: |
28+
DEV_BRANCHES=$(git branch -r --list origin/v?.?-dev)
29+
for DEV_BRANCH in $DEV_BRANCHES; do
30+
BASE=${DEV_BRANCH:7}
31+
EXISTS=$(gh pr list --base $BASE --head $HEAD \
32+
--json number --jq '.[] | .number')
33+
if [ ! -z "$EXISTS" ]; then
34+
echo "PR #$EXISTS already wants to merge $HEAD into $BASE"
35+
continue
36+
fi
37+
38+
gh pr create --base $BASE --head $HEAD \
39+
--label "Housekeeping" \
40+
--title "$BASE: update from $HEAD" \
41+
--body "Merge \`$HEAD\` into \`$BASE\`."
42+
done
43+
env:
44+
GH_TOKEN: ${{ github.token }}
45+
HEAD: dev

CONTRIBUTING.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,11 @@ gitGraph TB:
429429
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.
430430

431431
- `sync-main-to-dev` opens a pull request with all the changes from the `main` branch that aren't yet included on `dev`.
432-
This needs a single approval from either maintainers or TSC and can be merged.
433-
The aim is to bring build script and repository documentation changes to the other branches.
434-
Published versions of the specifications and schemas will also move across branches with this approach.
432+
- `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.
433+
434+
These need a single approval from either maintainers or TSC and can be merged.
435+
The aim is to bring build script and repository documentation changes to the other branches.
436+
Published versions of the specifications and schemas will also move across branches with this approach.
435437

436438
## Appendix: Issue Automation
437439

0 commit comments

Comments
 (0)