Repository navigation
Add a reusable check that blocks AI attribution in pull requests - #4
Merged
Merged
Conversation
One dependency-free Python script reads every commit of a pull request through the GitHub API, plus the PR title and description, and fails on co-author trailers or footers that credit an AI tool. The pattern list lives only in the script and its tests. Repositories call .github/workflows/no-ai-attribution.yml through the small caller in workflow-templates/. This repository runs the unit tests and the check on its own pull requests. Closes #3 Signed-off-by: ditahkk <ditah.k@zsoftly.com>
Anchor the footer pattern so feature text that mentions AI passes, limit the trailer match to the name, and add assisted-by trailers and a few more tools. Flag commits whose author or committer is an AI tool, since a squash merge turns them into co-author trailers. Retry transient API errors, skip Renovate and Dependabot app variants, ignore comments and the diff in local hook mode, exit cleanly outside a pull request so merge queues work, and run private repos on the shared self-hosted runners to save hosted minutes. Signed-off-by: ditahkk <ditah.k@zsoftly.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3
What
scripts/no-ai-attribution/check.py: one short Python 3 script, standard library only. It reads the PR title, description and every commit (paged through the GitHub API) and fails on lines that credit an AI tool: co-author trailers naming an AI tool or vendor, AI vendor noreply addresses, and the "made with a robot" footers some tools append. The pattern list lives in one place in the script.scripts/no-ai-attribution/test_check.py: blocked and allowed fixtures, including plain mentions of tool names (a CLI config commit, an egress allowlist) that must pass..github/workflows/no-ai-attribution.yml: reusableworkflow_callworkflow withcontents: readandpull-requests: read. Third-party action pinned to a full SHA.workflow-templates/no-ai-attribution.yml: the caller each repo adds. Check name:no-ai-attribution / check..github/workflows/ci.yml: runs the tests and the check on this repo's own PRs, using the PR's version of the script.Why this and not an existing tool
gh api orgs/zsoftlyreports the Free plan, and the org rulesets API returns "Upgrade to GitHub Team".Dependabot and Renovate
Their PR descriptions quote upstream release notes, so the description is skipped for those two bot accounts. Their commits are still checked.
Test