@sentry/junior-github 0.136.1 → 0.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SETUP.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GitHub plugin setup
|
|
2
2
|
|
|
3
|
-
This plugin exposes two skills — `github-code` (clone, source-code investigation, pull requests) and `github-issues` (issue workflows). Junior uses GitHub App installation tokens for reads, workflow dispatches, allowlisted issue and pull request writes (including pull request reviews and inline review comments), and Git branch pushes. Human OAuth is reserved for explicitly personal operations such as user-attachment uploads.
|
|
3
|
+
This plugin exposes two skills — `github-code` (clone, source-code investigation, pull requests) and `github-issues` (issue workflows). Junior uses GitHub App installation tokens for reads, workflow dispatches, reruns, and cancellations, allowlisted issue and pull request writes (including pull request reviews and inline review comments), and Git branch pushes. Human OAuth is reserved for explicitly personal operations such as user-attachment uploads.
|
|
4
4
|
|
|
5
5
|
## 1) Create/install GitHub App
|
|
6
6
|
|
|
@@ -182,7 +182,7 @@ new resources through the typed tools, for example
|
|
|
182
182
|
Use `gh` for the allowlisted lifecycle operations described by the skill.
|
|
183
183
|
|
|
184
184
|
`gh` supports either direct `GITHUB_TOKEN` (for local debugging) or sandbox-level header injection.
|
|
185
|
-
The plugin uses installation credentials for read-only GitHub traffic, workflow dispatches, allowlisted issue and pull request mutations (including reviews and inline review comments), and Git smart-HTTP pushes. The installed GitHub App permissions still need to cover the operation: actions for workflow dispatches, issues for issue edits/comments/labels, contents for pushes, pull requests for PR mutations/reviews/inline comments, and workflows for workflow-file pushes.
|
|
185
|
+
The plugin uses installation credentials for read-only GitHub traffic, workflow dispatches, reruns, and cancellations, allowlisted issue and pull request mutations (including reviews and inline review comments), and Git smart-HTTP pushes. The installed GitHub App permissions still need to cover the operation: actions for workflow dispatches, reruns, and cancellations, issues for issue edits/comments/labels, contents for pushes, pull requests for PR mutations/reviews/inline comments, and workflows for workflow-file pushes.
|
|
186
186
|
|
|
187
187
|
Committing and pushing code uses more than one GitHub surface:
|
|
188
188
|
|
|
@@ -200,8 +200,8 @@ Be careful with mixed-surface PR commands. Use the allowlisted REST endpoints
|
|
|
200
200
|
rather than GraphQL-backed `gh pr` mutation commands. PR-native title, body,
|
|
201
201
|
base, state, ready-for-review, and requested-reviewer changes use pull request
|
|
202
202
|
endpoints. Comments, labels, and assignees use GitHub's issue endpoints. All
|
|
203
|
-
allowlisted bot writes share `installation-write`; merge, branch deletion, REST
|
|
204
|
-
|
|
203
|
+
allowlisted bot writes share `installation-write`; merge, branch deletion, REST ref
|
|
204
|
+
mutation, and administration remain unsupported API operations.
|
|
205
205
|
|
|
206
206
|
For PR creation in automation, push explicitly and pass that branch as `head`:
|
|
207
207
|
|
package/dist/index.js
CHANGED
|
@@ -4280,6 +4280,11 @@ function githubApiWriteGrantName(method, upstreamUrl) {
|
|
|
4280
4280
|
)) {
|
|
4281
4281
|
return "installation-write";
|
|
4282
4282
|
}
|
|
4283
|
+
if (method === "POST" && (/^\/repos\/[^/]+\/[^/]+\/actions\/runs\/[^/]+\/(cancel|rerun|rerun-failed-jobs)$/.test(
|
|
4284
|
+
pathname
|
|
4285
|
+
) || /^\/repos\/[^/]+\/[^/]+\/actions\/jobs\/[^/]+\/rerun$/.test(pathname))) {
|
|
4286
|
+
return "installation-write";
|
|
4287
|
+
}
|
|
4283
4288
|
if (method === "POST" && /^\/repos\/[^/]+\/[^/]+\/issues$/.test(pathname)) {
|
|
4284
4289
|
return "installation-write";
|
|
4285
4290
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior-github",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.138.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@sinclair/typebox": "^0.34.49",
|
|
32
32
|
"drizzle-orm": "^0.45.2",
|
|
33
33
|
"zod": "^4.4.3",
|
|
34
|
-
"@sentry/junior-plugin-api": "0.
|
|
34
|
+
"@sentry/junior-plugin-api": "0.138.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "^25.9.1",
|
|
@@ -13,7 +13,7 @@ Treat explicit repo flags as command-targeting safety rails, not as a credential
|
|
|
13
13
|
| Permission capability | Commands |
|
|
14
14
|
| ---------------------------- | ------------------------------------------------------------------------------------ |
|
|
15
15
|
| `github.actions.read` | `gh run list`, `gh run view`, `gh run watch`, `gh workflow list`, `gh workflow view` |
|
|
16
|
-
| `github.actions.write` | `gh workflow run`
|
|
16
|
+
| `github.actions.write` | `gh workflow run`, `gh run rerun`, `gh run cancel` |
|
|
17
17
|
| `github.contents.read` | `gh repo clone`, `git fetch` |
|
|
18
18
|
| `github.contents.write` | Git smart-HTTP `git push` only |
|
|
19
19
|
| `github.workflows.write` | Workflow-file changes carried by Git smart-HTTP push |
|
|
@@ -38,6 +38,9 @@ Treat explicit repo flags as command-targeting safety rails, not as a credential
|
|
|
38
38
|
| Stage and commit | `git -C DIRECTORY add -A && git -C DIRECTORY commit -m "message"` |
|
|
39
39
|
| Push branch before PR creation | `git -C DIRECTORY push -u origin BRANCH` |
|
|
40
40
|
| Dispatch workflow | `gh workflow run WORKFLOW --repo owner/repo --ref REF [-f key=value]` |
|
|
41
|
+
| Rerun workflow run | `gh run rerun RUN_ID -R owner/repo [--failed]` |
|
|
42
|
+
| Rerun workflow job | `gh run rerun --job JOB_ID -R owner/repo` |
|
|
43
|
+
| Cancel workflow run | `gh run cancel RUN_ID -R owner/repo` |
|
|
41
44
|
| Create pull request (draft) | `github_createPullRequest({ repo: "owner/repo", head: "BRANCH", base: "BASE", title: "...", body: "...", draft: true })` |
|
|
42
45
|
| Update pull request | `gh api repos/owner/repo/pulls/NUMBER --method PATCH --input payload.json` |
|
|
43
46
|
| Mark ready for review | `gh api repos/owner/repo/pulls/NUMBER/ready_for_review --method POST` |
|
|
@@ -72,7 +75,7 @@ jr-rpc config set github.repo owner/repo
|
|
|
72
75
|
- If the commit changes workflow files under `.github/workflows`, the App installation needs Workflows write in addition to Contents write.
|
|
73
76
|
- Before rebasing, merge-base analysis, blame/history inspection, or a base comparison, check whether the repository is shallow. Fetch a bounded depth of the base into `refs/remotes/origin/BASE`, deepen incrementally until the needed ancestry is present, and compare against `origin/BASE`; use `--unshallow` only when bounded deepening is insufficient. Never force-push to work around missing ancestry.
|
|
74
77
|
- Before `github_createPullRequest`, push the head branch explicitly and resolve the target repo's default branch for `base`. That push requires GitHub write access to the remote.
|
|
75
|
-
- Merge, fork creation,
|
|
78
|
+
- Merge, fork creation, REST contents/Git database writes, and repository administration are outside the current write allowlist.
|
|
76
79
|
- Pull request reviews and inline review comments use the same repository-scoped `installation-write` credential as other bot-owned PR writes, so they post as Junior even on headless turns. Merge remains denied.
|
|
77
80
|
- If the explicit `git push` fails with 401/403 or another access/permission error, verify the repo context and retry once. If it still fails, load troubleshooting guidance and report the exact command failure.
|
|
78
81
|
- PR comments, labels, and assignees use GitHub's issue endpoints; use the `github-issues` REST guidance for those operations. All allowlisted bot writes share the same repository-scoped `installation-write` credential.
|