Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix view_file tool for external repos and remove process.env.GITHUB_TOKEN usage #91

Merged
merged 5 commits into from
Aug 28, 2024

Conversation

AtlantisPleb
Copy link
Contributor

@AtlantisPleb AtlantisPleb commented Aug 28, 2024

This PR addresses the issue described in #90. The view_file tool has been updated to correctly handle external repository parameters without prepending the context repository owner.

Changes made:

  1. Removed the initial check for context.repo at the beginning of the function.
  2. Used optional chaining when accessing context.repo properties.
  3. Simplified the error handling for missing repository information.
  4. Removed the use of process.env.GITHUB_TOKEN and added a check for context.gitHubToken.

These changes ensure that the tool works correctly for both the context repository and external repositories specified in the parameters, and that it only uses the GitHub token provided in the context.

Closes #90

Copy link

vercel bot commented Aug 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2024 1:50pm

@AtlantisPleb AtlantisPleb changed the title Fix view_file tool for external repos Fix view_file tool for external repos and remove process.env.GITHUB_TOKEN usage Aug 28, 2024
Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

2 similar comments
Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

Copy link

The Vercel build for this PR has failed. Please check the Vercel deployment logs for more information.

@AtlantisPleb AtlantisPleb merged commit c39116f into main Aug 28, 2024
2 of 3 checks passed
@AtlantisPleb AtlantisPleb deleted the issue-90-fix-view-file-external-repos branch August 28, 2024 13:53
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.

view_file does not work for repos not in current context
1 participant