Skip to content

fix: restrict bonk commands to repo members, collaborators, and owners#327

Merged
james-elicx merged 1 commit intomainfrom
fix/bonk-author-association
Mar 7, 2026
Merged

fix: restrict bonk commands to repo members, collaborators, and owners#327
james-elicx merged 1 commit intomainfrom
fix/bonk-author-association

Conversation

@james-elicx
Copy link
Copy Markdown
Collaborator

Summary

  • Adds author_association check to both bonk.yml and bigbonk.yml, matching the existing pattern in deploy-preview-command.yml
  • /bonk, @ask-bonk, and /bigbonk can now only be triggered by MEMBER, COLLABORATOR, or OWNER — preventing arbitrary users from invoking the AI agent

@james-elicx
Copy link
Copy Markdown
Collaborator Author

/bigbonk review this pr

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Mar 7, 2026

Open in StackBlitz

npm i https://pkg.pr.new/vinext@327

commit: 1be38ad

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2026

Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Mar 7, 2026

This PR is straightforward and correct. Here's my review:

Changes look good. Both bonk.yml and bigbonk.yml now gate on author_association, matching the exact same pattern already established in deploy-preview-command.yml (lines 22-26). This closes a real security gap — without this check, any GitHub user could comment /bonk or /bigbonk on an issue or PR and trigger the AI agent workflow, which has contents: write and pull-requests: write permissions and access to secrets (Cloudflare API tokens).

A few specific observations:

  1. Pattern consistency — The author_association values (MEMBER, COLLABORATOR, OWNER) and the multi-line YAML formatting match deploy-preview-command.yml exactly. Good.

  2. Existing bot check preserved — The github.event.sender.type != 'Bot' guard remains, preventing recursive triggers if the agent posts comments containing the trigger words.

  3. No functional regressions — The trigger conditions (/bonk, @ask-bonk, /bigbonk) are unchanged; only the authorization gate is added.

  4. Minor notecontains() is a substring match, so a comment like "don't use /bonk" would still trigger the workflow for authorized users. This is pre-existing behavior and not introduced by this PR, so not a concern here.

No issues found. This is a clean security hardening change.

github run

@james-elicx james-elicx enabled auto-merge (squash) March 7, 2026 17:32
@james-elicx james-elicx merged commit 3e09831 into main Mar 7, 2026
23 checks passed
@james-elicx james-elicx deleted the fix/bonk-author-association branch March 7, 2026 17:32
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