chore: fix some bugs with conventional commits, ref NOISSUE
This commit is contained in:
@@ -46,6 +46,7 @@ create_file() {
|
||||
}
|
||||
|
||||
get_commit_range() {
|
||||
rm $TEMP_FILE_PATH/messages.txt
|
||||
if [[ $LAST_TAG =~ $PATTERN ]]; then
|
||||
create_file true
|
||||
else
|
||||
@@ -62,16 +63,20 @@ start() {
|
||||
increment_type=""
|
||||
|
||||
while read message; do
|
||||
if [[ $message =~ (([a-zA-Z]+)(\(.+\))?\!:)|(BREAKING CHANGE:) ]]; then
|
||||
echo $message
|
||||
if echo $message | grep -Pq '(feat|style)(\([\w]+\))?!:([a-zA-Z0-9-_!\&\.\%\(\)\=\w\s]+)\s?(,?\s?)((ref(s?):?\s?)(([A-Z0-9]+\-[0-9]+)|(NOISSUE)))'; then
|
||||
increment_type="major"
|
||||
echo "a"
|
||||
break
|
||||
elif [[ $message =~ (^(feat|style)(\(.+\))?:) ]]; then
|
||||
elif echo $message | grep -Pq '(feat|style)(\([\w]+\))?:([a-zA-Z0-9-_!\&\.\%\(\)\=\w\s]+)\s?(,?\s?)((ref(s?):?\s?)(([A-Z0-9]+\-[0-9]+)|(NOISSUE)))'; then
|
||||
if [ -z "$increment_type" ] || [ "$increment_type" == "patch" ]; then
|
||||
increment_type="minor"
|
||||
fi
|
||||
elif [[ $message =~ ^((fix|build|perf|refactor|revert)(\(.+\))?:) ]]; then
|
||||
echo "b"
|
||||
fi
|
||||
elif echo $message | grep -Pq '(build|fix|perf|refactor|revert)(\(.+\))?:\s([a-zA-Z0-9-_!\&\.\%\(\)\=\w\s]+)\s?(,?\s?)((ref(s?):?\s?)(([A-Z0-9]+\-[0-9]+)|(NOISSUE)))'; then
|
||||
if [ -z "$increment_type" ]; then
|
||||
increment_type="patch"
|
||||
echo "c"
|
||||
fi
|
||||
fi
|
||||
done < $TEMP_FILE_PATH/messages.txt
|
||||
@@ -82,9 +87,10 @@ start() {
|
||||
|
||||
gitchangelog | grep -v "[rR]elease:" > HISTORY.md
|
||||
git add DotnetTestLib/VERSION HISTORY.md
|
||||
git commit -m "release: version $(cat DotnetTestLib/VERSION) 🚀"
|
||||
echo "creating git tag : $(cat DotnetTestLib/VERSION)"
|
||||
git tag $(cat DotnetTestLib/VERSION)
|
||||
echo $new_version > DotnetTestLib/VERSION
|
||||
git commit -m "release: version $new_version 🚀"
|
||||
echo "creating git tag : $new_version"
|
||||
git tag $new_version
|
||||
git push -u origin HEAD --tags
|
||||
echo "Gitea Actions will detect the new tag and release the new version."
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user