Skip to content

Commit a8eba9e

Browse files
committed
Adjust errors
1 parent 9807955 commit a8eba9e

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

action.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,26 @@ runs:
4040
[[ "${{ inputs.force-patch-increment }}" == 'true' ]] && opt='-p'
4141
new_version="$(${{ github.action_path }}/scripts/detectNewVersion.sh $opt)"
4242
echo "new-version=$new_version" | tee $GITHUB_OUTPUT
43+
fi
44+
if [[ "$new_version" =~ "520" ]]; then
45+
echo -e "ERROR: 599 - - You must source this script when specifying an environment variable! Eg: '. ./foo.sh -e bar_ver'"
46+
exit 1 || true
47+
fi
48+
if [[ "$new_version" =~ "570" ]]; then
49+
echo -e "ERROR: 570 - Invalid argument!"
50+
exit 1 || true
51+
fi
52+
if [[ "$new_version" =~ "590" ]]; then
53+
echo -e "FATAL: 501 - This is not a git repository!"
54+
exit 1 || true
55+
fi
56+
if [[ "$new_version" =~ "591" ]]; then
57+
echo -e "ERROR: 591 - Unsupported origin host."
58+
exit 1 || true
59+
fi
60+
if [[ "$new_version" =~ "599" ]]; then
61+
echo -e "ERROR: 599 - No feature, enhancement, fix, bugfix, hotfix, or ops branches detected!"
62+
exit 1 || true
4363
shell: bash
4464

4565
# See github contexts for more like github.action_path.

scripts/detectNewVersion.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ while getopts "he:vfp" opt; do
9797
;;
9898
*)
9999
echo -e "\e[01;31mERROR\e[00m: 570 - Invalid argument!"
100-
echo "::error title=Argument Error::ERROR 570 - Invalid argument!"
101100
printHelp
102101
if [[ "$sourced" == 0 ]]; then
103102
exit 0
@@ -155,7 +154,6 @@ case "$origin_host" in
155154
;;
156155
*)
157156
echo -e "\e[01;31mERROR\e[0m: 591 - Unsupported origin host."
158-
echo "::error title=Origin Host Error::ERROR 591 - Unsupported origin host!"
159157
exit 1
160158
;;
161159
esac
@@ -167,7 +165,6 @@ esac
167165
if [[ -n $arg_e ]]; then
168166
if [[ "$sourced" == 0 ]]; then
169167
echo -e "[$(${tsCmd})] \e[01;31mERROR\e[00m: 520 - You must source this script when specifying an environment variable! Eg: '. ./${0##*/} -e foo_ver'\n"
170-
echo "::error title=Usage Error::ERROR 520 - You must source this script when specifying an environment variable! Eg: '. ./foo.sh -e bar_ver'"
171168
exit 1
172169
fi
173170
fi
@@ -208,7 +205,6 @@ if [[ -n $arg_f ]]; then
208205
else
209206
if [[ -z $incrementMajor && -z $count_feature && -z $count_enhancement && -z $count_fix && -z $count_bugfix && -z $count_hotfix && -z $count_ops ]]; then
210207
echo -e "\e[01;31mERROR\e[00m: 599 - No feature, enhancement, fix, bugfix, hotfix, or ops branches detected!"
211-
echo "::error title=No Valid Merge Detected::ERROR 599 - No feature, enhancement, fix, bugfix, hotfix, or ops branches detected!"
212208
exit 1
213209
fi
214210
fi

0 commit comments

Comments
 (0)