Feat/Syncghviews #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Block AI Content | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: ["**"] | |
| jobs: | |
| check-for-forbidden-content: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check Commit Authors and Messages | |
| run: | | |
| echo "Checking for prohibited terms in commit data..." | |
| RANGE="HEAD~1..HEAD" | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| RANGE="${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}" | |
| fi | |
| # Check for "Claude" but exclude this workflow file's name/content references in logs if possible | |
| # Realistically, we just look for the string "Generated by..." or "Co-Authored-By: Claude" | |
| if git log "$RANGE" --format="%b" | grep -iE "Generated with|Co-Authored-By: Claude"; then | |
| echo "::error::Found AI watermark in commit body!" | |
| exit 1 | |
| fi | |
| # Strict author check | |
| if git log "$RANGE" --format="%an %ae" | grep -i "Claude"; then | |
| echo "::error::Found AI author!" | |
| exit 1 | |
| fi | |
| - name: Check File Content | |
| run: | | |
| # Grep for "Claude" with standard exclude flags. | |
| # -r: recursive | |
| # -I: ignore binary files | |
| # -i: case insensitive | |
| if grep -rI "Claude" . --exclude-dir=.git --exclude="block-ai.yml" --exclude=".mailmap"; then | |
| echo "::error::Found prohibited content in files!" | |
| exit 1 | |
| fi |