We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d57ea9 commit a7dcc9fCopy full SHA for a7dcc9f
.github/workflows/sync-main.yml
@@ -29,7 +29,18 @@ jobs:
29
run: |
30
git config user.name "github-actions[bot]"
31
git config user.email "github-actions[bot]@users.noreply.github.com"
32
- git checkout -B auto/sync-main-pr origin/auto/sync-main-pr
+ - name: Git checkout auto/sync-main-pr
33
+ shell: bash
34
+ run: |
35
+ git fetch origin
36
+ if git ls-remote --exit-code --heads origin auto/sync-main-pr > /dev/null; then
37
+ echo "Branch exists remotely. Checking it out."
38
+ git checkout -B auto/sync-main-pr origin/auto/sync-main-pr
39
+ else
40
+ echo "Branch does not exist remotely. Creating from main."
41
+ git checkout -B auto/sync-main-pr origin/main
42
+ git push -u origin auto/sync-main-pr
43
+ fi
44
- name: Sync origin/main
45
shell: bash
46
0 commit comments