* Add AGENTS.md with requirement to disclose agent authorship. * Check for edits to AGENTS.md * Add PR label on detected AI authorship. This PR adds an automated check if a contributor used an AI Agent to generate code. It does this by: - Adding an AGENT.md requesting the Agent to add a "co-authored by" line to each commit message it generates. - An added workflow (`llm_check.yml`) runs to check for any commit having such a matched line in it. - If it finds it, it adds the `AI/LLM` label. The label IS NOT removed automatically if a force push changes the commit message. The additional `get_real_pr_shas.yml` is a requirement sadly. It is currently impossible to get the commit the PR is based on via Github APIs. The variables `github.base_ref` or `github.pull_request.base.sha` either return the commit hash when the PR was created (breaks after rebase) or the new HEAD of the base branch after something unrelated was merged (see: https://github.com/actions/runner/issues/1689). This makes it effectively impossible to get the output of `git log actual_pr_base..HEAD` via the Github API.
5 lines
271 B
Markdown
5 lines
271 B
Markdown
# Hard requirements
|
|
|
|
- If an agent was involved in ANY code changes the commit message MUST end with: `Co-authored-by agent: <AGENT_NAME>/<MODEL_NAME>`.
|
|
- Variables `<AGENT_NAME>` and `<MODEL_NAME>` MUST be set by the agent.
|
|
- This file (AGENTS.md) MUST NOT be edited.
|