summaryrefslogtreecommitdiff
path: root/evergreen/commit_message_validate.sh
diff options
context:
space:
mode:
authorRichard Samuels <richard.l.samuels@gmail.com>2021-05-03 09:03:26 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-12 19:26:12 +0000
commitf7235a380065092cacf65f15841eb98f6c52c1b4 (patch)
treeb74be5a4668f4988a745c5f1c3fdc19b89847ffc /evergreen/commit_message_validate.sh
parentadd1a7ef0ae1146f4ebd04b6bc0a0db30093726f (diff)
downloadmongo-f7235a380065092cacf65f15841eb98f6c52c1b4.tar.gz
SERVER-55626 Extract normal shell scripts from evergreen.yml part 4
Diffstat (limited to 'evergreen/commit_message_validate.sh')
-rw-r--r--evergreen/commit_message_validate.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/evergreen/commit_message_validate.sh b/evergreen/commit_message_validate.sh
new file mode 100644
index 00000000000..64883e98a9c
--- /dev/null
+++ b/evergreen/commit_message_validate.sh
@@ -0,0 +1,20 @@
+DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
+. "$DIR/prelude.sh"
+
+cd src
+
+set -o verbose
+set -o errexit
+if [ "${is_commit_queue}" = "true" ]; then
+ # Since `commit_message` is an evergreen expansion, we need a way to ensure we
+ # properly deal with any special characters that could cause issues (like "). To
+ # do this, we will write it out to a file, then read that file into a variable.
+ cat >commit_message.txt <<END_OF_COMMIT_MSG
+${commit_message}
+END_OF_COMMIT_MSG
+
+ commit_message_content=$(cat commit_message.txt)
+
+ activate_venv
+ $python buildscripts/validate_commit_message.py "$commit_message_content"
+fi