Skip to content

Commit f48420f

Browse files
committed
should now checkout branches correctly
1 parent a59e6f7 commit f48420f

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

.github/workflows/update-timestamps.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,32 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v2
1515

16+
- name: Check automation branch exists
17+
id: auto-branch-check
18+
run: |
19+
git fetch
20+
branches=$(git branch -r)
21+
set +e
22+
echo $branches | grep auto/bump-timestamps
23+
branch_exists="$?"
24+
echo "branch_exists=$branch_exists" >> "$GITHUB_OUTPUT"
25+
26+
- name: Create automation branch
27+
if: ${{ steps.auto-branch-check.outputs.branch_exists }} == 0
28+
run: |
29+
git checkout -b auto/bump-timestamps
30+
git config --global --add --bool push.autoSetupRemote true
31+
git push
32+
33+
- uses: actions/checkout@v2
34+
with:
35+
ref: auto/bump-timestamps
36+
1637
- name: Check for updated Ark timestamps and replace in defaults.yml
1738
run: |
1839
dev/setup-env.sh
1940
. venv/bin/activate
2041
. environments/.stackhpc/activate
21-
git checkout auto/bump-timestamps || git checkout -b auto/bump-timestamps
22-
git pull origin auto/bump-timestamps
2342
ansible-playbook ansible/ci/update_timestamps.yml -v
2443
2544
- name: Check if timestamps were changed
@@ -56,6 +75,8 @@ jobs:
5675
runs-on: ubuntu-latest
5776
steps:
5877
- uses: actions/checkout@v2
78+
with:
79+
ref: auto/bump-timestamps
5980

6081
- name: Bump CI with new images
6182
run: |

0 commit comments

Comments
 (0)