Exclude bots from Claude and OpenCode workflows - #104
Conversation
There was a problem hiding this comment.
💡 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' |
There was a problem hiding this comment.
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 👍 / 👎.
| && (! github.event.pull_request.draft) | ||
| && (! startsWith(github.head_ref, 'dependabot/')) | ||
| && (! startsWith(github.head_ref, 'renovate/')) | ||
| && github.event.pull_request.user.type != 'Bot' |
There was a problem hiding this comment.
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/'))|
Review submitted successfully for #104: OpenCode PR Review: 1 inline finding(s). |

Summary
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.ymlreview job requiresgithub.event.pull_request.user.type != 'Bot'opencode-review.ymluses the same generic PR author type guard while preserving the existing draft and author-association checksopencode-bot.ymlcomment-triggered path requiresgithub.event.comment.user.type != 'Bot'