-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider adding a git hook to check for invalid commit messages #550
Comments
2 tasks
Can you link to a case where this actually failed? I haven't seen any issue like this myself, so I suspect it may be more nuanced. And/or submit example PRs that show this rejection behavior? |
I think it was because i had 'fix' in the title rather than Fix. I think it would look like this cat .githooks/commit-msg #!/bin/bash
#
# Purpose: Check that message has correct format
# Check for issue tag in commit message
issue_tag_regex="^((Fix|HotFix|Part)\s\#[0-9]+,\s[a-zA-Z0-9]+|Merge\spull\srequest\s\#[0-9]+\s[a-zA-Z0-9]+|IC:\s[a-zA-Z0-9]+)"
if ! grep -qE "$issue_tag_regex" "$1"; then
cat << EOF
ERROR - Commit message does not contain proper format
Expected Commit Format: (Fix|HotFix|Part) #ZZZ, message
EOF
exit 1
fi
exit 0 |
skliper
changed the title
format check fails on nasa#ZZZZ
Consider adding a git hook to check for invalid commit messages
Sep 8, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist (Please check before submitting)
Describe the bug
See title, on pull requests the commit message is reworded form #zzz to nasa#zzzz
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Code snips
If applicable, add references to the software.
System observed on:
Additional context
Add any other context about the problem here.
Reporter Info
Full name and company/organization if applicable
The text was updated successfully, but these errors were encountered: