Skip to content

Commit 2f85e90

Browse files
authored
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.
1 parent 4c5e9d6 commit 2f85e90

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1414
with:
1515
fetch-depth: '0'
16+
fetch-tags: true
1617

1718
- name: Set env variables
1819
run: |
@@ -73,7 +74,7 @@ jobs:
7374
IMAGE_RELEASE=$(echo ${IMAGE_INFO} | jq -r '.Labels.build_version' | awk '{print $3}')
7475
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-nbxyz' '{print $1}')
7576
NB_RELEASE_NUMBER=$(echo ${IMAGE_RELEASE} | awk -F'-nbxyz' '{print $2}')
76-
TAG_SHA=$(git rev-list -n 1 ${IMAGE_RELEASE})
77+
TAG_SHA=$(git rev-list -n 1 ${IMAGE_RELEASE} 2>/dev/null || echo "")
7778
if [ -z "${MULTIDIGEST}" ] || [ "${MULTIDIGEST}" == "null" ]; then
7879
echo "**** No existing container build found, assuming first build ****"
7980
VERSION_TAG=${WEBAPP_RELEASE}-nbxyz1

0 commit comments

Comments
 (0)