Skip to content

Commit dab0e9b

Browse files
committed
pr-checks: reject commits attributing work to an AI tool
Second, clone-independent check alongside the new local commit-msg/ pre-push hooks (ci_scripts/check_no_ai_attribution.sh) - a PR from a checkout that never installed them still gets caught here.
1 parent f7e64ce commit dab0e9b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎.github/workflows/pr-checks.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ jobs:
3030
exit 1
3131
fi
3232
33+
- name: Reject AI-attributed commits
34+
# Catches what the local commit-msg/pre-push hooks
35+
# (ci_scripts/git-hooks/, ci_scripts/check_no_ai_attribution.sh) exist to
36+
# prevent, for a clone that never installed them.
37+
env:
38+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
39+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
40+
run: |
41+
set -euo pipefail
42+
status=0
43+
for commit in $(git rev-list "$BASE_SHA..$HEAD_SHA"); do
44+
if ! git log --format=%B -1 "$commit" | ci_scripts/check_no_ai_attribution.sh -; then
45+
echo "::error::Commit $commit attributes work to an AI tool; see the message above."
46+
status=1
47+
fi
48+
done
49+
exit $status
50+
3351
check_patches:
3452
runs-on: ubuntu-latest
3553
steps:

0 commit comments

Comments
 (0)