@@ -6,7 +6,7 @@ A simple script, doing some natural language processing, to inhibit
66
77## What?
88A Python3 script, easy to integrate with various CI machinery
9- (e.g. see [ TravisCI example] ( https:// github.com/platisd/bad-commit-message-blocker/blob/master/.travis.yml ) )
9+ (e.g. see [ GitHub Actions example] ( # github-action ) )
1010that is meant to keep bad commit messages out of a project. It verifies
1111whether the [ seven rules of a great Git commit message] ( https://chris.beams.io/posts/git-commit/ )
1212by Chris Beams, are being followed:
@@ -66,4 +66,31 @@ appropriate arguments:
6666 * ` --subject-limit ` (defaults to ` 50 ` ) to set the subject line limit. E.g.:
6767 * ` python3 bad_commit_message_blocker.py --subject-limit 80 --message "Add a really cool feature" `
6868 * ` --body-limit ` (defaults to ` 72 ` ) to set the body line limit. E.g.:
69- * ` python3 bad_commit_message_blocker.py --body-limit 120 --message "Add a really cool feature" `
69+ * ` python3 bad_commit_message_blocker.py --body-limit 120 --message "Add a really cool feature" `
70+
71+ ## GitHub Action
72+
73+ Now you can use this script as part of your ** GitHub Actions** CI pipeline.
74+
75+ An example configuration can be seen below:
76+
77+ ``` yaml
78+ name : Commit messages
79+
80+ on : [pull_request]
81+
82+ jobs :
83+ check-commit-message :
84+ runs-on : ubuntu-20.04
85+ steps :
86+ - name : Verify commit messages follow best practices in CI
87+ uses : platisd/bad-commit-message-blocker@master
88+ with :
89+ github_token : ${{ secrets.GITHUB_TOKEN }}
90+ # Optionally set the subject character limit (default `50`)
91+ subject_limit : 60
92+ # Optionally set the body character limit (default `72`)
93+ body_limit : 100
94+ # Optionally set the remote branch name to merge (default `master`)
95+ remote_branch : dev
96+ ` ` `
0 commit comments