Skip to content

Commit a101666

Browse files
committed
Do not fail on non-existing prev tag
1 parent 93df8a1 commit a101666

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/java-publish-maven.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,11 @@ jobs:
205205
RELEASE_NOTES=$(envsubst < $GITHUB_WORKSPACE/.github/workflows/java.notes.template)
206206
207207
# Get the previous tag for generating notes
208+
# grep returns exit 1 when no lines match (first release), so
209+
# append "|| true" to prevent pipefail from aborting the script.
208210
PREV_TAG=$(git tag --list 'java/v*' --sort=-version:refname \
209211
| grep -Fxv "${CURRENT_TAG}" \
210-
| head -n 1)
212+
| head -n 1 || true)
211213
212214
echo "Current tag: ${CURRENT_TAG}"
213215
echo "Previous tag: ${PREV_TAG}"

0 commit comments

Comments
 (0)