Skip to content

Commit

Permalink
ci: Add basic pull request checker
Browse files Browse the repository at this point in the history
We check style with my hacky style checker and also make sure the email
address of the author doesn't have noreply in it. Right now the style
checking is only the last 10 commits, which may include other people's
work.

Sponsored by:		Netflix
  • Loading branch information
bsdimp committed May 24, 2023
1 parent e49bbf0 commit b71e624
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/prereq.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Quick Checker

on:
push:
branches: [ 'ci-*' ]
pull_request:
branches: [ 'main' ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
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 -color=always HEAD~10..HEAD
11 changes: 11 additions & 0 deletions tools/build/check-email.sh
Original file line number Diff line number Diff line change
@@ -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 --pretty="%ae" "$@" | grep noreply) || exit 1
if [ -n "${bad}" ] ; then
echo "Found the following bad email addresses: ${bad}"
exit 1
fi
exit 0

0 comments on commit b71e624

Please sign in to comment.