14 - uses: actions/checkout@v2
16 ref: ${{ github.event.pull_request.head.sha }}
19 - name: Determine branch name
21 BRANCH="${GITHUB_BASE_REF#refs/heads/}"
22 echo "Building for $BRANCH"
23 echo "BRANCH=$BRANCH" >> $GITHUB_ENV
25 - name: Test formalities
27 source .github/workflows/ci_helpers.sh
30 for commit in $(git rev-list HEAD ^origin/$BRANCH); do
31 info "=== Checking commit '$commit'"
32 if git show --format='%P' -s $commit | grep -qF ' '; then
33 err "Pull request should not include merge commits"
37 author="$(git show -s --format=%aN $commit)"
38 if echo $author | grep -q '\S\+\s\+\S\+'; then
39 success "Author name ($author) seems ok"
41 err "Author name ($author) need to be your real name 'firstname lastname'"
45 subject="$(git show -s --format=%s $commit)"
46 if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_\.-]\+: ' -e '^Revert '; then
47 success "Commit subject line seems ok ($subject)"
49 err "Commit subject line MUST start with '<area>: ' ($subject)"
53 body="$(git show -s --format=%b $commit)"
54 sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
55 if echo "$body" | grep -qF "$sob"; then
56 success "Signed-off-by match author"
58 err "Signed-off-by is missing or doesn't match author (should be '$sob')"
62 if echo "$body" | grep -v "Signed-off-by:"; then
63 success "A commit message exists"
65 err "Missing commit message. Please describe your changes"