Skip to content

Commit

Permalink
[CI] Fix commit message length check
Browse files Browse the repository at this point in the history
  • Loading branch information
lierdakil committed May 25, 2020
1 parent fdf3481 commit 8e23b09
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ on:
- 'man/**'

jobs:
check-commit-msg:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Check commit message
run: |
# Get last commit message
if git log -1 --no-merges --pretty=format:"%s" | grep -qE "^[^#].{78}"; then
echo "Last commit log contains a line with more than 78 characters."
exit 1
else
echo "Commit log looks good."
fi
linux:

runs-on: ubuntu-latest
Expand All @@ -58,17 +74,6 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Check commit message
run: |
# Get last commit message
git log -1 --pretty=format:"%s" --no-merges | grep -c "^[^#].{78}"
if [ $? -eq 0 ]; then
echo "Last commit log contains a line with more than 78 characters."
exit 1
else
echo "Commit log looks good."
fi
# declare/restore cached things
# caching doesn't work for scheduled runs yet
# https://github.com/actions/cache/issues/63
Expand Down

0 comments on commit 8e23b09

Please sign in to comment.