Skip to content

fix(github): drop capability scoping, use full installation scope#420

Merged
dcramer merged 4 commits into
mainfrom
feat/github-workflows-permission
May 27, 2026
Merged

fix(github): drop capability scoping, use full installation scope#420
dcramer merged 4 commits into
mainfrom
feat/github-workflows-permission

Conversation

@sentry-junior
Copy link
Copy Markdown
Contributor

@sentry-junior sentry-junior Bot commented May 27, 2026

The capabilities list in plugin.yaml was being translated into a scoped permissions object on every token mint. This meant any GitHub permission not listed in capabilities would 403 — even when the app installation already had it. That's the wrong trust boundary.

This PR:

  • Removes the capabilities block from plugin.yaml entirely
  • Updates the broker to omit permissions from the token request when no capabilities are declared — GitHub then issues a full-scope installation token
  • Adds Workflows: Write to setup docs, since that installation permission is needed to push workflow files
  • Keeps capabilitiesToPermissions functional for any plugin that explicitly declares capabilities

The GitHub App installation settings remain the real permission boundary.

Changed:

  • packages/junior-github/plugin.yaml — capabilities block removed
  • packages/junior/src/chat/plugins/auth/github-app-broker.ts — permissions field omitted from token request when capabilities absent
  • packages/junior/tests/unit/plugins/github-app-broker.test.ts — tests updated for no-capabilities default + capabilities-present case
  • packages/junior-github/SETUP.md + packages/docs/.../github-plugin.md — Workflows: Write added to installation setup checklist

Fixes #400

Action taken on behalf of David Cramer.


View Session in Sentry

Adds workflows.read and workflows.write to the GitHub plugin
capabilities, and updates setup docs accordingly.

Fixes #400

Action taken on behalf of David Cramer.

---
[View Session in Sentry](https://sentry.sentry.io/traces/?project=4510944073809921&query=gen_ai.conversation.id%3A%22slack%3AC0AHB7N2JCR%3A1779917010.421049%22)
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment May 27, 2026 10:23pm

Request Review

Capabilities were being translated into a scoped permissions object on
every token mint, which meant any GitHub permission not listed would 403
even when the app installation had it. Since the installation is the real
trust boundary, omit the permissions field entirely and let GitHub return
a full-scope installation token.

- Remove capabilities block from plugin.yaml
- Broker skips permissions in token request when no capabilities declared
- Capabilities still work for plugins that explicitly declare them
- Update tests to reflect new no-scoping default

Fixes #400
@sentry-junior sentry-junior Bot changed the title feat(github): add workflows read/write permission fix(github): drop capability scoping, use full installation scope May 27, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 34173ee. Configure here.

Comment thread packages/junior-github/plugin.yaml
@dcramer dcramer merged commit 6a1c5c7 into main May 27, 2026
16 checks passed
@dcramer dcramer deleted the feat/github-workflows-permission branch May 27, 2026 22:43
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.

Add workflows write permission for workflow PRs

1 participant