File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 push :
1212 branches :
1313 - main
14+ workflow_dispatch : {}
1415
1516jobs :
1617 sync-branch :
@@ -30,17 +31,25 @@ jobs:
3031 id : pull_request
3132 shell : bash
3233 run : |
33- EXISTS=$(gh pr list --base $BASE --head $HEAD \
34+ SYNC="$BASE-sync-with-$HEAD"
35+ git checkout -b $SYNC origin/$SYNC || git checkout -b $SYNC origin/$BASE
36+ git merge origin/$HEAD
37+ git checkout origin/dev src/*
38+ git checkout origin/dev tests/*
39+ git commit -m "Restored src/* and tests/*"
40+ git push -u origin $SYNC
41+
42+ EXISTS=$(gh pr list --base $BASE --head $SYNC \
3443 --json number --jq '.[] | .number')
3544 if [ ! -z "$EXISTS" ]; then
36- echo "PR #$EXISTS already wants to merge $HEAD into $BASE"
45+ echo "PR #$EXISTS already wants to merge $SYNC into $BASE"
3746 exit 0
3847 fi
3948
40- gh pr create --base $BASE --head $HEAD \
49+ gh pr create --base $BASE --head $SYNC \
4150 --label "Housekeeping" \
42- --title "$BASE: update from $HEAD" \
43- --body "Merge \`$HEAD\` into \`$BASE\`."
51+ --title "$BASE: sync with $HEAD" \
52+ --body "Merge relevant changes from \`$HEAD\` into \`$BASE\`."
4453 env :
4554 GH_TOKEN : ${{ steps.generate-token.outputs.token }}
4655 HEAD : main
You can’t perform that action at this time.
0 commit comments