File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change 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+ - main-workflow-sync-dev-to-vX.Y-dev # TODO: remove after testing
15+
16+ jobs :
17+ sync-branches :
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : Checkout repository
21+ uses : actions/checkout@v4
22+ with :
23+ fetch-depth : 0
24+
25+ - name : Create pull requests
26+ id : pull_requests
27+ shell : bash
28+ run : |
29+ git branch -r --list
30+ DEV_BRANCHES=$(git branch -r --list origin/v?.?-dev)
31+ for DEV_BRANCH in $DEV_BRANCHES; do
32+ BASE=${DEV_BRANCH:7}
33+ EXISTS=$(gh pr list --base $BASE --head $HEAD \
34+ --json number --jq '.[] | .number')
35+ if [ ! -z "$EXISTS" ]; then
36+ echo "PR #$EXISTS already wants to merge $HEAD into $BASE"
37+ continue
38+ fi
39+
40+ gh pr create --base $BASE --head $HEAD \
41+ --label "Housekeeping" \
42+ --title "$BASE: update from $HEAD" \
43+ --body "Merge \`$HEAD\` into \`$BASE\`."
44+ done
45+ env :
46+ GH_TOKEN : ${{ github.token }}
47+ HEAD : dev
You can’t perform that action at this time.
0 commit comments