Skip to content

Commit ad2e877

Browse files
NkotihalSSingh5845
authored andcommitted
Update automerge_driver_main_to_dev_6_2_0.yml
Fixing failure
1 parent 3cc6458 commit ad2e877

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/automerge_driver_main_to_dev_6_2_0.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,28 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Manually clone the repository
14-
run: |
15-
git init
16-
git remote add origin https://github.com/${{ github.repository }}.git
17-
git fetch origin main
18-
git fetch origin dev-6.2.0-b.1
19-
git checkout -b dev-6.2.0-b.1 origin/dev-6.2.0-b.1
13+
- name: Checkout main branch
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
submodules: true
2018

2119
- name: Configure Git
2220
run: |
2321
git config --global user.name "github-actions[bot]"
2422
git config --global user.email "github-actions[bot]@users.noreply.github.com"
2523
24+
- name: Ensure dev branch exists
25+
run: |
26+
if git ls-remote --exit-code --heads origin dev-6.2.0-b.1; then
27+
echo "Branch exists on remote"
28+
git fetch origin dev-6.2.0-b.1
29+
git checkout dev-6.2.0-b.1
30+
else
31+
echo "Branch does not exist, creating it"
32+
git checkout -b dev-6.2.0-b.1
33+
fi
34+
2635
- name: Force replace dev branch with main branch contents (including submodules)
2736
run: |
2837
set -e

0 commit comments

Comments
 (0)