Add a sign-off check in the workflow #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Signed-off Commits | |
on: | |
pull_request: | |
types: | |
- synchronize | |
- opened | |
- reopened | |
jobs: | |
check-signed-off: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Check signed-off commits | |
run: | | |
for commit in $(git rev-list --first-parent ${{ github.event.before }}..${{ github.sha }}); do | |
if ! git log --format=%B -n 1 $commit | grep -q "^Signed-off-by: "; then | |
echo "Commit $commit is not signed off." | |
exit 1 | |
fi | |
done |