14 - uses: actions/checkout@v3
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 subject="$(git show -s --format=%s $commit)"
38 if echo "$subject" | grep -q -e '^[0-9A-Za-z,+/_-]\+: ' -e '^Revert '; then
39 success "Commit subject line seems ok ($subject)"
41 err "Commit subject line MUST start with '<package name>: ' ($subject)"
45 body="$(git show -s --format=%b $commit)"
46 sob="$(git show -s --format='Signed-off-by: %aN <%aE>' $commit)"
47 if echo "$body" | grep -qF "$sob"; then
48 success "Signed-off-by match author"
50 err "Signed-off-by is missing or doesn't match author (should be '$sob')"