Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to patch version bump when no commit prefix provided #1149

Merged
merged 2 commits into from
Dec 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading