Skip to content

Commit bc7aaf3

Browse files
authored
Merge pull request #4393 from OAI/main-workflow-sync-main-to-devf
main: new workflow that syncs main to dev
2 parents 249dcef + b58c0a9 commit bc7aaf3

File tree

2 files changed

+50
-0
lines changed

2 files changed

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

CONTRIBUTING.md

+10
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ For information on the branch and release strategy for OAS 3.0.4 and 3.1.1 and e
305305

306306
* `main` is used to publish finished work and hold the authoritative versions of general documentation such as this document, which can be merged out to other branches as needed. The `src` tree is ***not*** present on `main`.
307307
* `dev` is the primary branch for working with the `src` tree, which is kept up-to-date with the most recent release on the most recent minor (X.Y) release line, and serves as the base for each new minor release line. Development infrastructure that is not needed on `main` is maintained here, and can be merged out to other non-`main` branches as needed.
308+
Changes on `main` are automatically included in a pull request to `dev` (see the (section on [branch sync](#branch-sync-automation)).
308309
* `vX.Y-dev` is the minor release line development branch for X.Y, including both the initial X.Y.0 minor version and all subsequent X.Y.Z patch versions. All PRs are made to oldest active `vX.Y-dev` branch to which the change is relevant, and then merged forward as shown in the diagram further down in this document.
309310
* `vX.Y.Z-rel` is the release branch for an X.Y.Z release (including when Z == 0). It exists primarily for `git mv`-ing `src/oas.md` to the appropriate `versions/X.Y.Z.md` location before merging back to `main`, and can also be used for any emergency post-release fixes that come up, such as when a 3rd party changes URLs in a way that breaks published links.
310311

@@ -423,6 +424,15 @@ gitGraph TB:
423424
commit id:"3.3 work"
424425
```
425426

427+
### Branch sync automation
428+
429+
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.
430+
431+
- `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.
435+
426436
## Appendix: Issue Automation
427437

428438
### Automated closure of issues Process

0 commit comments

Comments
 (0)