Open source · modulane
ai-disclosure
v1.0.0modulane/ai-disclosure
A GitHub Action that fails a pull request until it says whether AI tools were used, and how.
Fetched from GitHub
- Stars
- 0
- Forks
- 0
- Contributors
- 1
- Open issues
- 0
- Closed issues
- 0
- Open PRs
- 0
- Closed PRs
- 5
- Licence
- MIT
- Updated
Live from GitHub · synced
Languages
- JavaScript100.0%
README Full README ↗
Fetched from GitHub
A GitHub Action that fails a pull request until its description says whether AI tools were used, and how.
Reviewers read AI-assisted code differently, and more and more projects ask contributors to say when they used it. A line in the contributing guide is easy to miss. This check makes the question part of every pull request: one box to tick, a few words when AI helped, and nothing for bots.
- A required answer, not a reminder. As a required status check, it blocks the merge until the author answers, either way.
- No judgement. It never guesses whether code was written by AI. It only asks the author to say so.
- Safe on forks. It reads the description from the event: no token, no checkout, no code from the pull request.
- Plain Markdown. The disclosure is two boxes in your pull request template, worded as you like.
How it works
The pull request template gets an AI use section with two boxes:
## AI use <!-- Required, for everyone. Tick exactly one box. --> - [ ] No AI tool was used - [ ] AI tools were used, as described here: <!-- If AI tools were used, name each one and what it did. -->
The check passes when exactly one box is ticked. With AI tools were used, the author also writes which tools and what they did, after the box on the same line or on the lines under it. Comments from the template never count as that description, and neither do the boxes or sections around it.
Editing the description runs the check again. Make it a required status check, and a pull request cannot be merged without a disclosure.
The action reads the description from the event. It needs no token and no checkout, and it never runs code from the pull request. Dependabot needs no disclosure, and other bots can be exempted too.