Skip to content

Commit 85b588a

Browse files
committed
Fix for failing to check out the latest tag
1 parent be246fb commit 85b588a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/build-push-apptainer.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ jobs:
2626

2727
- name: Get latest tag
2828
id: tag
29-
run: echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
29+
run: |
30+
if ! LATEST_TAG=$(git describe --tags --abbrev=0); then
31+
echo "::error::No tags found in repository"
32+
exit 1
33+
fi
34+
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
3035
3136
- name: Build SIF image
3237
run: |

.github/workflows/build-push-docker.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ jobs:
2323

2424
- name: Get latest tag
2525
id: tag
26-
run: echo "LATEST_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
26+
run: |
27+
if ! LATEST_TAG=$(git describe --tags --abbrev=0); then
28+
echo "::error::No tags found in repository"
29+
exit 1
30+
fi
31+
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
2732
2833
- name: Log in to Docker Hub
2934
uses: docker/login-action@v3

0 commit comments

Comments
 (0)