Skip to content

Merge branch 'main' of https://github.com/QuantumChemist/OpenGLaDOS #3

Merge branch 'main' of https://github.com/QuantumChemist/OpenGLaDOS

Merge branch 'main' of https://github.com/QuantumChemist/OpenGLaDOS #3

name: Check Commit Author
on: push
jobs:
author-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1 # only fetches the latest commit
- name: Verify current commit author
run: |
# List of banned authors and emails
banned_authors=("linus torvalds" "satoshi nakamoto" "elon musk")
banned_emails=("[email protected]" "[email protected]" "[email protected]")
# Get author name and email for the current commit only
author=$(git show -s --format='%an' ${{ github.sha }})
email=$(git show -s --format='%ae' ${{ github.sha }})
# Check banned authors
for banned in "${banned_authors[@]}"; do
if [[ "${author,,}" == "${banned,,}" ]]; then
echo "Blocked: Commit attributed to banned author '$banned'."
exit 1
fi
done
# Check banned emails
for banned in "${banned_emails[@]}"; do
if [[ "${email,,}" == "${banned,,}" ]]; then
echo "Blocked: Commit attributed to banned email '$banned'."
exit 1
fi
done
echo "Author check passed. No banned commit author found."