From 8c98439135f66a84063cb91eca43fc546e9ad152 Mon Sep 17 00:00:00 2001 From: Chris Hunt Date: Sun, 9 Jul 2017 21:19:14 -0400 Subject: [PATCH] chore(ci): pass expected path to validate-commit-msg We pass the path relative to the .git directory, which is what `validate-commit-msg` is expecting. A few extra items will also be traced in case anything breaks in the future. Fixes #2753 --- scripts/validate-commit-msg.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/validate-commit-msg.sh b/scripts/validate-commit-msg.sh index 74dece6a1..489d5fae7 100755 --- a/scripts/validate-commit-msg.sh +++ b/scripts/validate-commit-msg.sh @@ -19,14 +19,20 @@ if [ -z "$COMMIT_REV" ]; then exit 1 fi + # Resolve our file for output # DEV: We use `.git` to avoid cluttering the working directory GIT_DIR="$(git rev-parse --git-dir)" -TARGET_FILE="$GIT_DIR/VALIDATE_COMMIT_MSG" +TARGET_FILENAME=VALIDATE_COMMIT_MSG +TARGET_FILE="$GIT_DIR/$TARGET_FILENAME" +echo "Retrieving relevant commit message for $COMMIT_REV" # Output our log message to a file # DEV: We use `--no-merges` to skip merge commits introduced by GitHub git log --no-merges --format=format:"%s" -n 1 "$COMMIT_REV" > "$TARGET_FILE" +echo "Validating contents of $TARGET_FILE" +cat "$TARGET_FILE" + # Validate our message -./node_modules/.bin/validate-commit-msg "$TARGET_FILE" +./node_modules/.bin/validate-commit-msg "$TARGET_FILENAME"