File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Expand file tree Collapse file tree 1 file changed +42
-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+ workflow_dispatch : {}
15+
16+ jobs :
17+ sync-branch :
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : Checkout repository
21+ uses : actions/checkout@v4
22+
23+ - name : Create pull request
24+ id : pull_request
25+ shell : bash
26+ run : |
27+ EXISTS=$(gh pr list --base $BASE --head $HEAD \
28+ --json number --jq '.[] | .number')
29+ if [ ! -z "$EXISTS" ]; then
30+ echo "PR #$EXISTS already wants to merge $HEAD into $BASE"
31+ exit 0
32+ fi
33+
34+ gh pr create --base $BASE --head $HEAD \
35+ --label "Housekeeping" \
36+ --reviewer "OAI/TSC" \
37+ --title "$BASE: update from $HEAD" \
38+ --body "Merge \`$HEAD\` into \`$BASE\`."
39+ env :
40+ GH_TOKEN : ${{ github.token }}
41+ HEAD : main
42+ BASE : dev
You can’t perform that action at this time.
0 commit comments