fork(81) download
  1. #!/bin/bash
  2. FILE_CONTENT="PBCL2-666 [fix] whatever"
  3. REGEX="^[[:upper:]]{4}[0-9]-[0-9]{3} \[(fix|poc|chore|feat|refactor|style|test)] .*"
  4. if [[ $FILE_CONTENT =~ $REGEX ]]; then
  5. echo "Nice commit!"
  6. else
  7. echo "Bad commit \"$FILE_CONTENT\", check format."
  8. echo $ERROR_MSG
  9. exit 1
  10. fi
Success #stdin #stdout 0s 4296KB
stdin
Standard input is empty
stdout
Nice commit!