From 57e2d7fc1d3dcf391c96baf5179bc5f1f79bf21d Mon Sep 17 00:00:00 2001 From: wtripp180901 Date: Fri, 20 Dec 2024 15:48:09 +0000 Subject: [PATCH] should now checkout branches correctly --- .github/workflows/update-timestamps.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-timestamps.yml b/.github/workflows/update-timestamps.yml index 1227e3ca7..5ab1cb538 100644 --- a/.github/workflows/update-timestamps.yml +++ b/.github/workflows/update-timestamps.yml @@ -13,13 +13,31 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Check automation branch exists + id: auto-branch-check + run: | + git fetch + branches=$(git branch -r) + set +e + echo $branches | grep auto/bump-timestamps + echo "branch_exists=$?" >> "$GITHUB_OUTPUT" + + - name: Create automation branch + if: ${{ steps.auto-branch-check.outputs.branch_exists }} == 1 + run: | + git checkout -b auto/bump-timestamps + git config --global --add --bool push.autoSetupRemote true + git push + + - uses: actions/checkout@v2 + with: + ref: auto/bump-timestamps + - name: Check for updated Ark timestamps and replace in defaults.yml run: | dev/setup-env.sh . venv/bin/activate . environments/.stackhpc/activate - git checkout auto/bump-timestamps || git checkout -b auto/bump-timestamps - git pull origin auto/bump-timestamps ansible-playbook ansible/ci/update_timestamps.yml -v - name: Check if timestamps were changed @@ -56,6 +74,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + ref: auto/bump-timestamps - name: Bump CI with new images run: |