Skip to content

Commit

Permalink
Fix setting base tag on branches
Browse files Browse the repository at this point in the history
  • Loading branch information
discordianfish committed Oct 4, 2023
1 parent b63e63e commit be7142d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-push-agents-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ jobs:
id: base-tag
run: |
semver=${{ steps.meta.outputs.version }}
major=${semver%%.*}
# If not a semver (e.g branch name), use main as base tag
if [[ $major == "$semver" ]]; then
if [[ ! $semver =~ ^[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "tag=main" >> "$GITHUB_OUTPUT"
exit 0
fi
major=${semver%%.*}
minor_and_patch=${semver#*.}
minor=${minor_and_patch%%.*}
echo "tag=v${major}.${minor}" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit be7142d

Please sign in to comment.