Skip to content

Commit dd4ace0

Browse files
committed
fatimage now only created if head is timestamp commit
1 parent 58e0af8 commit dd4ace0

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.github/workflows/update-timestamps.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
upstream_check:
1010
outputs:
11-
timestamps_changed: "{{ steps.timestamp_check.outputs.timestamps_changed }}"
11+
new_fatimage: "{{ steps.fatimage_check.outputs.new_fatimage }}"
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
@@ -56,19 +56,35 @@ jobs:
5656
git config user.name 'github-actions[bot]'
5757
git config user.email 'github-actions[bot]@users.noreply.github.com'
5858
git commit -m "Bumped repo timestamps"
59+
git notes add -m "timestamp_bump_commit"
5960
git config --global --add --bool push.autoSetupRemote true
6061
git push
62+
63+
- name: Check if new fatimage needed
64+
id: fatimage_check
65+
run: |
66+
NEED_NEW_IMAGE=false
67+
set +e
68+
if $(git notes show) ; then
69+
HEAD_NOTES=$(git notes show)
70+
if [[ $HEAD_NOTES == "timestamp_bump_commit" ]] ; then
71+
NEED_NEW_IMAGE=true
72+
fi
73+
fi
74+
set -e
75+
echo "new_fatimage=$NEED_NEW_IMAGE" >> "$GITHUB_OUTPUT"
76+
6177
6278
# todo: don't skip if rerun
6379
build_fatimage:
64-
if: needs.upstream_check.outputs.timestamps_changed == '1'
80+
if: needs.upstream_check.outputs.new_fatimage == 'true'
6581
needs: upstream_check
6682
uses: stackhpc/ansible-slurm-appliance/.github/workflows/fatimage.yml@auto/bump-timestamps
6783
with:
6884
ci_cloud: LEAFCLOUD
6985

7086
ci_and_pr:
71-
if: needs.upstream_check.outputs.timestamps_changed == '1'
87+
if: needs.upstream_check.outputs.new_fatimage == 'true'
7288
needs:
7389
- upstream_check
7490
- build_fatimage

0 commit comments

Comments
 (0)