CI: Allow the GitHub Actions bot to make release PRs #34076
Conversation
|
View your CI Pipeline Execution ↗ for commit 4ad2760
☁️ Nx Cloud last updated this comment at |
|
View your CI Pipeline Execution ↗ for commit 8c7472f ☁️ Nx Cloud last updated this comment at |
📝 WalkthroughWalkthroughExtends Danger script bypasses so pull requests authored by the GitHub Actions bot ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
✨ Finishing Touches
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/dangerfile.js`:
- Around line 150-157: The code incorrectly reads danger.github.pr.author into
the variable author causing undefined for contributor PRs; update the assignment
to use danger.github.pr.user instead and ensure subsequent checks that reference
author (and authorAssociation) still work (the conditional that checks
['OWNER','MEMBER'].includes(authorAssociation) and the bot check that uses
author.login and author.type should operate on the new author variable). Locate
the author/authorAssociation initialization and replace the source for author
from pr.author to pr.user so the bot/type access no longer throws a TypeError.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d1e979b3-df2b-4cae-9806-6dc9d392707f
📒 Files selected for processing (1)
scripts/dangerfile.js
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/dangerfile.js (1)
107-111: Clarify the comment to match the actual logic.The comment "(but never for agent bots)" is confusing—the condition explicitly allows
github-actions[bot](which is a bot) to bypass. The term "agent bots" is also ambiguous.Consider a clearer comment:
✏️ Suggested comment clarification
- // Bypass check for OWNER, MEMBER roles (but never for agent bots) + // Bypass check for human OWNER/MEMBER or the GitHub Actions release bot🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/dangerfile.js` around lines 107 - 111, Update the misleading comment above the bypass condition to reflect the actual logic: it allows users with authorAssociation 'OWNER' or 'MEMBER' if author.type !== 'Bot', but explicitly also allows the specific bot with author.login === 'github-actions[bot]'. Replace "but never for agent bots" with a clear phrase such as "except bots, with an explicit exception for the github-actions[bot] account" and reference the condition variables authorAssociation, author.type, and author.login so the comment unambiguously matches the if statement logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@scripts/dangerfile.js`:
- Around line 107-111: Update the misleading comment above the bypass condition
to reflect the actual logic: it allows users with authorAssociation 'OWNER' or
'MEMBER' if author.type !== 'Bot', but explicitly also allows the specific bot
with author.login === 'github-actions[bot]'. Replace "but never for agent bots"
with a clear phrase such as "except bots, with an explicit exception for the
github-actions[bot] account" and reference the condition variables
authorAssociation, author.type, and author.login so the comment unambiguously
matches the if statement logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 840a5e42-584c-45f0-b1ee-250221e23303
📒 Files selected for processing (1)
scripts/dangerfile.js
What I did
Allowed GitHub Actions Bot to bypass the PR branch check.
Checklist for Contributors
Testing
ø
Manual testing
ø (needs to be merged to test it)
Summary by CodeRabbit