Skip to content

Commit 0932cde

Browse files
ralfhandllornajane
authored andcommitted
Create sync-dev-to-vX.Y-dev.yaml
1 parent bc7aaf3 commit 0932cde

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
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

0 commit comments

Comments
 (0)