Skip to content

Commit e45bb31

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

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

.github/workflows/fatimage.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ on:
1515
ci_cloud:
1616
type: string
1717
default: LEAFCLOUD
18-
branch:
19-
type: string
20-
default: "${{ github.ref }}"
2118
outputs:
2219
openhpc-RL8-image:
2320
description: "RL8 image"
@@ -54,20 +51,7 @@ jobs:
5451
openhpc-RL9-image: "${{ steps.manifest.outputs.openhpc-RL9-image }}"
5552

5653
steps:
57-
58-
- name: Get current context
59-
id: get_branch
60-
run: |
61-
if [[ ${{ github.event_name == 'workflow_dispatch' }} == true ]]; then
62-
target_branch=${{ github.ref }}
63-
else
64-
target_branch=${{ github.event.inputs.branch }}
65-
fi
66-
echo "target_branch=$target_branch" >> "$GITHUB_OUTPUT"
67-
6854
- uses: actions/checkout@v2
69-
with:
70-
ref: ${{ steps.get_branch.outputs.target_branch }}
7155

7256
- name: Record settings for CI cloud
7357
run: |

.github/workflows/update-timestamps.yml

Lines changed: 24 additions & 3 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 == '1'
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
@@ -43,7 +62,7 @@ jobs:
4362
build_fatimage:
4463
if: "${{ needs.upstream_check.outputs.timestamps_changed }} == 0"
4564
needs: upstream_check
46-
uses: ./.github/workflows/fatimage.yml
65+
uses: stackhpc/ansible-slurm-appliance/.github/workflows/fatimage.yml@auto/bump-timestamps
4766
with:
4867
ci_cloud: LEAFCLOUD
4968
branch: auto/bump-timestamps
@@ -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)