Fix CI build failure in release workflow (#89)

- Add fetch-tags: true to ensure git tags are available during checkout
- Add error handling to git rev-list command to prevent script failure
  when referenced tag doesn't exist in the repository

Resolves the 'git rev-list' exit code 129 error in the release workflow.
This commit is contained in:
Antony Messerli 2025-06-12 01:11:42 -05:00 committed by GitHub
parent 4c5e9d6676
commit 2f85e90564
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,6 +13,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: '0'
fetch-tags: true
- name: Set env variables
run: |
@ -73,7 +74,7 @@ jobs:
IMAGE_RELEASE=$(echo ${IMAGE_INFO} | jq -r '.Labels.build_version' | awk '{print $3}')
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-nbxyz' '{print $1}')
NB_RELEASE_NUMBER=$(echo ${IMAGE_RELEASE} | awk -F'-nbxyz' '{print $2}')
TAG_SHA=$(git rev-list -n 1 ${IMAGE_RELEASE})
TAG_SHA=$(git rev-list -n 1 ${IMAGE_RELEASE} 2>/dev/null || echo "")
if [ -z "${MULTIDIGEST}" ] || [ "${MULTIDIGEST}" == "null" ]; then
echo "**** No existing container build found, assuming first build ****"
VERSION_TAG=${WEBAPP_RELEASE}-nbxyz1