Skip to content

Commit

Permalink
fix: dont add malformed tags if $MAJOR_VERSION is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
xynydev authored Aug 27, 2023
1 parent d04ad0f commit a1e2413
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ jobs:
BUILD_TAGS=()
# Have tags for tracking builds during pull request
SHA_SHORT="${GITHUB_SHA::7}"
COMMIT_TAGS+=("pr-${{ github.event.number }}-${MAJOR_VERSION}")
COMMIT_TAGS+=("${SHA_SHORT}-${MAJOR_VERSION}")
BUILD_TAGS=("${MAJOR_VERSION}" "${MAJOR_VERSION}-${TIMESTAMP}")
# Using clever bash string templating, https://stackoverflow.com/q/40771781
# don't make malformed tags if $MAJOR_VERSION is empty (base-image didn't include proper labels) --
COMMIT_TAGS+=("pr-${{ github.event.number }}${MAJOR_VERSION:+-$MAJOR_VERSION}")
COMMIT_TAGS+=("${SHA_SHORT}${MAJOR_VERSION:+-$MAJOR_VERSION}")
BUILD_TAGS=("${MAJOR_VERSION}" "${MAJOR_VERSION:+$MAJOR_VERSION-}${TIMESTAMP}")
# --
BUILD_TAGS+=("${TIMESTAMP}")
BUILD_TAGS+=("latest")
Expand Down

0 comments on commit a1e2413

Please sign in to comment.