Skip to content

Exclude bots from Claude and OpenCode workflows - #104

Merged
dceoy merged 3 commits into
mainfrom
agent/exclude-bot-claude-reviews
Aug 19, 2026
Merged

Exclude bots from Claude and OpenCode workflows#104
dceoy merged 3 commits into
mainfrom
agent/exclude-bot-claude-reviews

Conversation

@dceoy

@dceoy dceoy commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • skip Claude and OpenCode PR review jobs for PRs authored by GitHub bots
  • replace Dependabot/Renovate branch-name checks with the generic PR author type check
  • ignore bot-authored comments in the OpenCode mention workflow

Why

Bot-triggered AI jobs can fail or create unnecessary automation churn. Filtering on GitHub's actor type covers Dependabot, Renovate, and other GitHub bots without maintaining branch-name conventions.

Validation

  • claude.yml review job requires github.event.pull_request.user.type != 'Bot'
  • opencode-review.yml uses the same generic PR author type guard while preserving the existing draft and author-association checks
  • opencode-bot.yml comment-triggered path requires github.event.comment.user.type != 'Bot'
  • prompt-driven reusable-workflow behavior remains unchanged

@dceoy dceoy changed the title Exclude bot PRs from Claude review Exclude bots from Claude and OpenCode workflows Aug 19, 2026
@dceoy
dceoy marked this pull request as ready for review August 19, 2026 17:54

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 893fd43a68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

&& (! github.event.pull_request.draft)
&& (! startsWith(github.head_ref, 'dependabot/'))
&& (! startsWith(github.head_ref, 'renovate/'))
&& github.event.pull_request.user.type != 'Bot'

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 Badge Keep branch checks for non-App automation accounts

When self-hosted Renovate authenticates through a PAT or machine-user account, the PR author is reported as type: User even though its branch still uses the renovate/ prefix. Replacing the branch guards solely with this type check therefore makes the Claude review run again for those automated PRs; the same regression occurs in .github/workflows/opencode-review.yml:121 when that account has a trusted author association. Retain the Dependabot/Renovate branch exclusions alongside the generic Bot check.

Useful? React with 👍 / 👎.

@opencode-agent opencode-agent 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.

OpenCode PR Review: 1 inline finding(s). Review completed.

&& (! github.event.pull_request.draft)
&& (! startsWith(github.head_ref, 'dependabot/'))
&& (! startsWith(github.head_ref, 'renovate/'))
&& github.event.pull_request.user.type != 'Bot'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion · workflow-condition-correctness

The new github.event.pull_request.user.type != 'Bot' check skips GitHub App bots (including Dependabot and the hosted Mend Renovate app), but it does not cover self-hosted Renovate authenticated with a personal access token. Those PRs still use renovate/* branches but are authored by a regular user account (user.type == 'User'), so the previous startsWith(github.head_ref, 'renovate/') guard caught them and the new check does not.

This causes the Claude Code review job (and the OpenCode review job in .github/workflows/opencode-review.yml) to run on PAT-based Renovate PRs, wasting CI resources and potentially posting unwanted reviews.

Consider keeping both checks:

      && github.event.pull_request.user.type != 'Bot'
      && (! startsWith(github.head_ref, 'renovate/'))

@opencode-agent

Copy link
Copy Markdown

Review submitted successfully for #104: OpenCode PR Review: 1 inline finding(s).

New%20session%20-%202026-08-19T17%3A54%3A21.810Z
opencode session  |  github run

@dceoy dceoy self-assigned this Aug 19, 2026
@dceoy
dceoy merged commit ddbf687 into main Aug 19, 2026
21 of 22 checks passed
@dceoy
dceoy deleted the agent/exclude-bot-claude-reviews branch August 19, 2026 18:05
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