Skip to content

Commit

Permalink
workflows: add signed-off check
Browse files Browse the repository at this point in the history
This adds a github workflow for checking the signed off line in commit
messages.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 8c09497)
  • Loading branch information
guits committed Jun 30, 2021
1 parent ac77bc5 commit 0e52ea0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/signed-off.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: signed-off
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: "${GITHUB_WORKSPACE}/tests/scripts/workflows/signed-off.sh"
9 changes: 9 additions & 0 deletions tests/scripts/workflows/signed-off.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -x

if [[ "$(git log --oneline --no-merges origin/"${GITHUB_BASE_REF}"..HEAD | wc -l)" -ne "$(git log --no-merges origin/"${GITHUB_BASE_REF}"..HEAD | grep -c Signed-off-by)" ]]; then
echo "One or more commits is/are missing a Signed-off-by. Add it with 'git commit -s'."
exit 1
else
echo "Sign-off ok!"
fi

0 comments on commit 0e52ea0

Please sign in to comment.