Skip to content

Commit 2155fe4

Browse files
committed
Merge remote-tracking branch 'origin/main' into dev-sync-with-main
2 parents ce19d33 + 814f927 commit 2155fe4

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

.github/workflows/sync-main-to-dev.yaml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,32 @@ jobs:
3131
id: pull_request
3232
shell: bash
3333
run: |
34-
EXISTS=$(gh pr list --base $BASE --head $HEAD \
34+
git config user.name ${GITHUB_ACTOR}
35+
git config user.email "[email protected]"
36+
SYNC="$BASE-sync-with-$HEAD"
37+
38+
git fetch origin -v
39+
git checkout -b $SYNC origin/$SYNC || git checkout -b $SYNC origin/$BASE
40+
git status
41+
git pull --allow-unrelated-histories
42+
43+
git merge origin/$HEAD
44+
git checkout origin/dev src/*
45+
git checkout origin/dev tests/*
46+
git commit -m "Restored src/* and tests/*"
47+
git push -u origin $SYNC
48+
49+
EXISTS=$(gh pr list --base $BASE --head $SYNC \
3550
--json number --jq '.[] | .number')
3651
if [ ! -z "$EXISTS" ]; then
37-
echo "PR #$EXISTS already wants to merge $HEAD into $BASE"
52+
echo "PR #$EXISTS already wants to merge $SYNC into $BASE"
3853
exit 0
3954
fi
4055
41-
gh pr create --base $BASE --head $HEAD \
56+
gh pr create --base $BASE --head $SYNC \
4257
--label "Housekeeping" \
43-
--title "$BASE: update from $HEAD" \
44-
--body "Merge \`$HEAD\` into \`$BASE\`."
58+
--title "$BASE: sync with $HEAD" \
59+
--body "Merge relevant changes from \`$HEAD\` into \`$BASE\`."
4560
env:
4661
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
4762
HEAD: main

0 commit comments

Comments
 (0)