Skip to content

fix(github): Point clone guidance at github_cloneRepository - #2165

Merged
dcramer merged 2 commits into
mainfrom
fix/github-deny-bash-clones
Oct 16, 2026
Merged

dcramer merged 2 commits into
mainfrom
fix/github-deny-bash-clones

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

github_cloneRepository checks for a matching Workspace before it clones. A raw git clone or gh repo clone skips that check, so the agent can work in a checkout without the Workspace setup. The github-code skill recommended gh repo clone as the default clone command.

This PR points all clone guidance at github_cloneRepository.

Changes

  • github-code skill: the action table and api-surface.md say to use github_cloneRepository, not git clone or gh repo clone. The gh repo clone troubleshooting row and the note about clone flags are removed.
  • workflow.md: clone with github_cloneRepository when no checkout or Workspace exists.
  • SETUP.md: CLI usage points to the tool.
  • self-update skill: calls github_cloneRepository with allowAdHoc: true, then runs fetch --deepen=200. A Workspace switch would replace the sandbox and remove the app checkout.

Checks

  • pnpm skills:check
  • pnpm --filter @sentry/junior-github typecheck

via David Cramer.

--

View Junior Session [Sentry]

github_cloneRepository checks for a matching Workspace before it clones.
A raw git clone or gh repo clone in bash skipped that check, so an agent
could make an ad-hoc checkout without the Workspace setup script.

The GitHub plugin beforeToolExecute hook now denies bash commands that
clone a GitHub repository and points the agent to github_cloneRepository.
Egress policy cannot do this because clone and fetch use the same
git-upload-pack requests.

The github-code skill and SETUP.md no longer recommend gh repo clone. The
self-update skill uses the clone tool with allowAdHoc, so it keeps the app
checkout instead of switching Workspaces.

Co-Authored-By: David Cramer <david@sentry.io>
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
junior-docs Ready Ready Preview Oct 16, 2026 6:30pm UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Oct 16, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 afd5892. Configure here.

Parsing bash commands to find clones is brittle. Cursor Bugbot found a
heredoc false positive, and more shell cases would follow. Remove
clone-policy.ts and the beforeToolExecute denial.

Keep the skill and doc changes. They point agents to
github_cloneRepository, which checks for a matching Workspace, and stop
recommending gh repo clone.

Co-Authored-By: David Cramer <david@sentry.io>
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: high PR risk score: high labels Oct 16, 2026
@sentry-junior sentry-junior Bot changed the title fix(github): Deny raw GitHub clones in bash fix(github): Point clone guidance at github_cloneRepository Oct 16, 2026
@dcramer
dcramer merged commit d73678d into main Oct 16, 2026
43 checks passed
@dcramer
dcramer deleted the fix/github-deny-bash-clones branch October 16, 2026 18:45

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 37204a28 Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant