Skip to content

Commit 8c98439

Browse files
committed
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
1 parent 7feaa5c commit 8c98439

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/validate-commit-msg.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,20 @@ if [ -z "$COMMIT_REV" ]; then
1919
exit 1
2020
fi
2121

22+
2223
# Resolve our file for output
2324
# DEV: We use `.git` to avoid cluttering the working directory
2425
GIT_DIR="$(git rev-parse --git-dir)"
25-
TARGET_FILE="$GIT_DIR/VALIDATE_COMMIT_MSG"
26+
TARGET_FILENAME=VALIDATE_COMMIT_MSG
27+
TARGET_FILE="$GIT_DIR/$TARGET_FILENAME"
2628

29+
echo "Retrieving relevant commit message for $COMMIT_REV"
2730
# Output our log message to a file
2831
# DEV: We use `--no-merges` to skip merge commits introduced by GitHub
2932
git log --no-merges --format=format:"%s" -n 1 "$COMMIT_REV" > "$TARGET_FILE"
3033

34+
echo "Validating contents of $TARGET_FILE"
35+
cat "$TARGET_FILE"
36+
3137
# Validate our message
32-
./node_modules/.bin/validate-commit-msg "$TARGET_FILE"
38+
./node_modules/.bin/validate-commit-msg "$TARGET_FILENAME"

0 commit comments

Comments
 (0)