Skip to content

Commit

Permalink
Default to patch version bump when no commit prefix provided (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
durera authored Dec 20, 2023
1 parent b4e06f0 commit d5c96fc
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions build/bin/initbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ else

PATCH_COUNT=`grep -ciF '[patch]' $GITHUB_WORKSPACE/.changelog`
echo "Patch commits : ${PATCH_COUNT}"
fi

if [ "$MAJOR_COUNT" -gt "0" ]; then
SEMVER_RELEASE_LEVEL="major"
elif [ "$MINOR_COUNT" -gt "0" ]; then
SEMVER_RELEASE_LEVEL="minor"
elif [ "$PATCH_COUNT" -gt "0" ]; then
SEMVER_RELEASE_LEVEL="patch"
if [ "$MAJOR_COUNT" -gt "0" ]; then
SEMVER_RELEASE_LEVEL="major"
elif [ "$MINOR_COUNT" -gt "0" ]; then
SEMVER_RELEASE_LEVEL="minor"
elif [ "$PATCH_COUNT" -gt "0" ]; then
SEMVER_RELEASE_LEVEL="patch"
fi
fi

echo "RELEASE LEVEL = ${SEMVER_RELEASE_LEVEL}"
Expand All @@ -82,7 +82,8 @@ else
semver bump ${SEMVER_RELEASE_LEVEL} ${SEMVER_LAST_TAG} > $VERSION_FILE
echo "Configuring semver for ${SEMVER_RELEASE_LEVEL} bump from ${SEMVER_LAST_TAG} to $(cat $VERSION_FILE)"
else
semver bump build build.$GITHUB_RUN_ID > $VERSION_FILE
# Default to a patch revision
semver bump patch ${SEMVER_LAST_TAG} > $VERSION_FILE
echo "Configuring semver for rebuild of ${SEMVER_LAST_TAG}: $(cat $VERSION_FILE)"
fi
fi
Expand Down

0 comments on commit d5c96fc

Please sign in to comment.