diff --git a/tools/checkPullRequestTitle.sh b/tools/checkPullRequestTitle.sh index 92628e71f..33d7beef4 100755 --- a/tools/checkPullRequestTitle.sh +++ b/tools/checkPullRequestTitle.sh @@ -1,7 +1,7 @@ #!/bin/bash _throw() { - echo "FAILED: Pull Request has $1" + echo "FAILED: Pull Request: $1" exit 1 } @@ -10,8 +10,19 @@ string="$*" echo "Validating '$string'..." -if [[ ${#string} -lt 20 ]]; then _throw "short name"; fi -if [[ $string == "Update cba_settings.sqf" ]]; then _throw "bad name"; fi +if [[ ${#string} -lt 20 ]]; then _throw "Short name"; fi +if [[ $string == "Update cba_settings.sqf" ]]; then _throw "Sad name"; fi +if [[ $string == "Update settings" ]]; then _throw "Sad name"; fi + +# Descriptor +if [[ $string != *"Added"* ]]; then _throw "missing descriptor [Added, Fixed, Adjusted, Updated]"; fi +if [[ $string != *"added"* ]]; then _throw "missing descriptor [Added, Fixed, Adjusted, Updated]"; fi +if [[ $string != *"Fixed"* ]]; then _throw "missing descriptor [Added, Fixed, Adjusted, Updated]"; fi +if [[ $string != *"fixed"* ]]; then _throw "missing descriptor [Added, Fixed, Adjusted, Updated]"; fi +if [[ $string != *"Updated"* ]]; then _throw "missing descriptor [Added, Fixed, Adjusted, Updated]"; fi +if [[ $string != *"updated"* ]]; then _throw "missing descriptor [Added, Fixed, Adjusted, Updated]"; fi +if [[ $string != *"Adjusted"* ]]; then _throw "missing descriptor [Added, Fixed, Adjusted, Updated]"; fi +if [[ $string != *"adjusted"* ]]; then _throw "missing descriptor [Added, Fixed, Adjusted, Updated]"; fi echo "SUCCESS" exit 0 \ No newline at end of file