From ce5bf6c7db9405d40241628f9dfdb407068543d8 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 23 May 2023 09:21:22 -0600 Subject: [PATCH] ci: Add basic pull request checker We check style with my hacky style checker and also make sure the email address of the author doesn't have noreply in it. Sponsored by: Netflix --- .github/workflows/prereq.yml | 27 +++++++++++++++++++++++++++ tools/build/check-email.sh | 11 +++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/prereq.yml create mode 100755 tools/build/check-email.sh diff --git a/.github/workflows/prereq.yml b/.github/workflows/prereq.yml new file mode 100644 index 00000000000000..6a3914ccbd7fb5 --- /dev/null +++ b/.github/workflows/prereq.yml @@ -0,0 +1,27 @@ +--- +name: Quick Checker + +on: + push: + branches: [ 'ci-*' ] + pull_request: + branches: [ 'main' ] + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 11 + - name: Check Email + run: sh ./tools/build/check-email.sh HEAD~10..HEAD + - name: Hack + run: git log -1 + - name: Check Style + run: ./tools/build/checkstyle9.pl HEAD~10..HEAD diff --git a/tools/build/check-email.sh b/tools/build/check-email.sh new file mode 100755 index 00000000000000..916db364a68cf6 --- /dev/null +++ b/tools/build/check-email.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# Quick check to make sure all emails in the branch are good +# Anything with noreply in the address + +bad=$(git log --prety="%ae" "$@" | grep noreply) +if [ -n "${bad}" ] ; then + echo "Found the following bad email addresses: ${bad}" + exit 1 +fi +exit 0