Skip to content

ci: reject coding tool attributions in PRs #1

ci: reject coding tool attributions in PRs

ci: reject coding tool attributions in PRs #1

Workflow file for this run

name: Commit check
on:
pull_request:
types: [opened, edited, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
no-tool-attribution:
# Reject coding tool attributions in commit messages and the PR description.
runs-on: ubuntu-slim
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check commit messages and PR description
env:
BASE_REF: ${{ github.base_ref }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_BODY: ${{ github.event.pull_request.body }}
run: |
pattern='noreply@anthropic\.com|co-authored-by:.*(claude|copilot|cursor|codex|gemini|aider)|generated (with|by) .*(claude|copilot|cursor|chatgpt|codex|gemini)'
{
git log --format=%B "origin/$BASE_REF..HEAD"
printf '%s\n%s\n' "$PR_TITLE" "$PR_BODY"
} > "$RUNNER_TEMP/messages.txt"
if grep -inE "$pattern" "$RUNNER_TEMP/messages.txt"; then
echo "::error::Remove coding tool attribution from the commit messages and PR description."
exit 1
fi