15 name: Check commit message
20 uses: actions/checkout@v2
22 # Checkout PR head commit
23 # Checkout Action use merge commit as default
24 ref: ${{ github.event.pull_request.head.sha }}
25 # Fetch all history and branch (default: 1)
28 - name: Get commit body
30 git log origin/${GITHUB_BASE_REF}..HEAD --format=%b > commit_msg.txt
31 sed '/^$/d' commit_msg.txt > commit_body.txt
33 - name: Check signed-off
35 # Check string starting from "Signed-off-by:"
36 count=$(cat commit_body.txt | grep 'Signed-off-by:' | wc -l)
37 if [[ ! "$count" -ge "1" ]]; then
41 echo "Signed-off-by is OK"
43 - name: Check body words
44 # Run if check_signed_off step is failed
47 count=$(cat commit_body.txt | sed '/Signed-off-by:/d' | wc -w)
48 echo "Commit body word check: $count words"
49 if [[ "$count" -lt "5" ]]; then