From 4f18c21c7ba78982eb9f90ae402b4c560ad72499 Mon Sep 17 00:00:00 2001 From: fitz123 Date: Tue, 28 Apr 2026 02:03:42 +0400 Subject: [PATCH] ci: enforce anonymous commit author identity --- .github/workflows/author-identity.yml | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/author-identity.yml diff --git a/.github/workflows/author-identity.yml b/.github/workflows/author-identity.yml new file mode 100644 index 0000000..bbb94f2 --- /dev/null +++ b/.github/workflows/author-identity.yml @@ -0,0 +1,31 @@ +name: Author Identity Check + +on: + pull_request: + branches: [main, master] + +jobs: + author-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Verify commit authors use noreply email + run: | + set -eu + base="${{ github.event.pull_request.base.sha }}" + head="${{ github.event.pull_request.head.sha }}" + bad=$(git log --pretty='%h %ae' "${base}..${head}" \ + | grep -v 'users\.noreply\.github\.com$' || true) + if [ -n "$bad" ]; then + echo "::error::PR contains commits with non-noreply author email:" + echo "$bad" + echo + echo "Fix locally:" + echo " git config user.email USER@users.noreply.github.com" + echo " git rebase -i \$base # squash/edit to apply new identity" + exit 1 + fi + echo "All commit author emails OK"