From 8c09497567308bac75212be77cdb7b1928d2d9a2 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Wed, 30 Jun 2021 00:24:01 +0200 Subject: [PATCH] workflows: add signed-off check This adds a github workflow for checking the signed off line in commit messages. Signed-off-by: Guillaume Abrioux --- .github/workflows/signed-off.yml | 10 ++++++++++ tests/scripts/workflows/signed-off.sh | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 .github/workflows/signed-off.yml create mode 100755 tests/scripts/workflows/signed-off.sh diff --git a/.github/workflows/signed-off.yml b/.github/workflows/signed-off.yml new file mode 100644 index 000000000..d88ea15b4 --- /dev/null +++ b/.github/workflows/signed-off.yml @@ -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" \ No newline at end of file diff --git a/tests/scripts/workflows/signed-off.sh b/tests/scripts/workflows/signed-off.sh new file mode 100755 index 000000000..4901fbc50 --- /dev/null +++ b/tests/scripts/workflows/signed-off.sh @@ -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 \ No newline at end of file