Skip to content

ci: add no-ai-lines check - #8

Closed
ricardofrantz wants to merge 2 commits into
mainfrom
ci/no-ai-lines
Closed

ricardofrantz wants to merge 2 commits into
mainfrom
ci/no-ai-lines

Conversation

@ricardofrantz

@ricardofrantz ricardofrantz commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Fails a pull request or a push to the default branch that carries AI session links or AI co-author lines.

View guided diff Turn on auto-fix

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/no-ai-lines.yml">

<violation number="1" location=".github/workflows/no-ai-lines.yml:39">
P2: A failed `jq` call inside `$(...)` passed as an argument is ignored under `set -e`, so the check silently passes on an empty value. Assign the output to a variable first, for example `title=$(jq ...)` on its own line, so the failure aborts the step.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

fi
}
if [ "$EVENT_NAME" = pull_request ]; then
check "PR title" "$(jq -r '.pull_request.title // ""' "$GITHUB_EVENT_PATH")"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: A failed jq call inside $(...) passed as an argument is ignored under set -e, so the check silently passes on an empty value. Assign the output to a variable first, for example title=$(jq ...) on its own line, so the failure aborts the step.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/no-ai-lines.yml, line 39:

<comment>A failed `jq` call inside `$(...)` passed as an argument is ignored under `set -e`, so the check silently passes on an empty value. Assign the output to a variable first, for example `title=$(jq ...)` on its own line, so the failure aborts the step.</comment>

<file context>
@@ -0,0 +1,56 @@
+            fi
+          }
+          if [ "$EVENT_NAME" = pull_request ]; then
+            check "PR title" "$(jq -r '.pull_request.title // ""' "$GITHUB_EVENT_PATH")"
+            check "PR body" "$(jq -r '.pull_request.body // ""' "$GITHUB_EVENT_PATH")"
+            gh api --paginate "repos/$REPO/pulls/$PR_NUMBER/commits" \
</file context>

Comment thread .github/workflows/no-ai-lines.yml Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/no-ai-lines.yml">

<violation number="1" location=".github/workflows/no-ai-lines.yml:29">
P2: The new `devin`, `kimi` and `gpt` alternatives match human names as well as AI tools. A commit with `Co-authored-by: Devin Smith <...>` now fails the check. Drop these bare tokens, or anchor them to an email or a tool-specific form.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
set -euo pipefail
banned='claude-session:|claude\.ai/code|co-authored-by:.*(claude|anthropic|copilot|cursor|grok|gemini|openai|codex|chatgpt|gpt|aider|devin|windsurf|deepseek|qwen|kimi)|generated (with|by) .*(claude|ai\b)|🤖'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The new devin, kimi and gpt alternatives match human names as well as AI tools. A commit with Co-authored-by: Devin Smith <...> now fails the check. Drop these bare tokens, or anchor them to an email or a tool-specific form.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/workflows/no-ai-lines.yml, line 29:

<comment>The new `devin`, `kimi` and `gpt` alternatives match human names as well as AI tools. A commit with `Co-authored-by: Devin Smith <...>` now fails the check. Drop these bare tokens, or anchor them to an email or a tool-specific form.</comment>

<file context>
@@ -25,17 +26,22 @@ jobs:
         run: |
           set -euo pipefail
-          banned='claude-session:|claude\.ai/code|co-authored-by:.*(claude|anthropic|copilot|cursor|grok|gemini|openai|codex)|generated (with|by) .*(claude|ai\b)|🤖'
+          banned='claude-session:|claude\.ai/code|co-authored-by:.*(claude|anthropic|copilot|cursor|grok|gemini|openai|codex|chatgpt|gpt|aider|devin|windsurf|deepseek|qwen|kimi)|generated (with|by) .*(claude|ai\b)|🤖'
           fail=0
           check() {
</file context>
Suggested change
banned='claude-session:|claude\.ai/code|co-authored-by:.*(claude|anthropic|copilot|cursor|grok|gemini|openai|codex|chatgpt|gpt|aider|devin|windsurf|deepseek|qwen|kimi)|generated (with|by) .*(claude|ai\b)|🤖'
banned='claude-session:|claude\.ai/code|co-authored-by:.*(claude|anthropic|copilot|cursor|grok|gemini|openai|codex|chatgpt|aider|windsurf|deepseek|qwen)|generated (with|by) .*(claude|ai\b)|🤖'

@ricardofrantz
ricardofrantz deleted the ci/no-ai-lines branch November 2, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant