oxidetalis/.forgejo/workflows/dco_checker.yml
Awiteb 6f217c945e
All checks were successful
DCO checker / DCO checker (pull_request) Successful in 3s
Rust CI / Rust CI (pull_request) Successful in 3m55s
feat: Create DCO CI checker
Signed-off-by: Awiteb <a@4rs.nl>
2024-07-14 03:39:41 +03:00

29 lines
932 B
YAML

name: DCO checker
on:
pull_request:
branches: [master]
types: [opened, synchronize, reopened]
jobs:
check:
name: DCO checker
runs-on: debian
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: DCO checker
run: |
commits=$(git rev-list origin/master..HEAD)
for commit in $commits; do
commit_subject=$(git show --quiet --format=%s $commit)
commit_sha=$(echo $commit | cut -c1-10)
echo "Checking commit $commit_sha \"$commit_subject\""
if ! git show --quiet --format=%B $commit | grep -q "Signed-off-by:"; then
author=$(git show --quiet --format=%an $commit)
echo "Commit $commit by $author is missing the 'Signed-off-by:' line"
exit 1
fi
done
echo "All commits have the 'Signed-off-by:' line."