Skip to content

Commit

Permalink
Added descriptior and minor adjustmetn to script
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasBrostrom committed Nov 6, 2023
1 parent 65c47ef commit c720e9e
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tools/checkPullRequestTitle.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

_throw() {
echo "FAILED: Pull Request has $1"
echo "FAILED: Pull Request: $1"
exit 1
}

Expand All @@ -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

0 comments on commit c720e9e

Please sign in to comment.