mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-13 16:14:07 -08:00
fix(Github Document Loader Node): Pass through apiUrl from credentials & fix log output (#11049)
This commit is contained in:
parent
50b723836e
commit
a7af98183c
|
@ -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),
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue