Skip to content

Commit

Permalink
No changes detected in view-file.ts; commit skipped.
Browse files Browse the repository at this point in the history
  • Loading branch information
AtlantisPleb committed Aug 28, 2024
1 parent b403b3c commit 1a5393c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tools/view-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,19 @@ export const viewFileTool = (context: ToolContext): CoreTool<typeof params, Resu
};
}

if (!context.gitHubToken) {
return {
success: false,
error: "Missing GitHub token",
summary: "Failed to view file due to missing GitHub token",
details: "The GitHub token is missing. Please ensure it is provided in the context."
};
}

try {
const content = await githubReadFile({
path,
token: context.gitHubToken ?? process.env.GITHUB_TOKEN ?? '',
token: context.gitHubToken,
repoOwner,
repoName,
branch: repoBranch
Expand Down

0 comments on commit 1a5393c

Please sign in to comment.