Skip to content

Commit

Permalink
fix(Github Document Loader Node): Pass through apiUrl from credential…
Browse files Browse the repository at this point in the history
…s & fix log output (#11049)
  • Loading branch information
OlegIvaniv authored Oct 2, 2024
1 parent 50b7238 commit a7af981
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,22 @@ export class DocumentGithubLoader implements INodeType {
0,
)) as CharacterTextSplitter | undefined;

const { index } = this.addInputData(NodeConnectionType.AiDocument, [
[{ json: { repository, branch, ignorePaths, recursive } }],
]);
const docs = new GithubRepoLoader(repository, {
branch,
ignorePaths: (ignorePaths ?? '').split(',').map((p) => p.trim()),
recursive,
accessToken: (credentials.accessToken as string) || '',
apiUrl: credentials.server as string,
});

const loadedDocs = textSplitter
? await textSplitter.splitDocuments(await docs.load())
: await docs.load();

this.addOutputData(NodeConnectionType.AiDocument, index, [[{ json: { loadedDocs } }]]);
return {
response: logWrapper(loadedDocs, this),
};
Expand Down

0 comments on commit a7af981

Please sign in to comment.