File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments