mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 08:34: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,
|
0,
|
||||||
)) as CharacterTextSplitter | undefined;
|
)) as CharacterTextSplitter | undefined;
|
||||||
|
|
||||||
|
const { index } = this.addInputData(NodeConnectionType.AiDocument, [
|
||||||
|
[{ json: { repository, branch, ignorePaths, recursive } }],
|
||||||
|
]);
|
||||||
const docs = new GithubRepoLoader(repository, {
|
const docs = new GithubRepoLoader(repository, {
|
||||||
branch,
|
branch,
|
||||||
ignorePaths: (ignorePaths ?? '').split(',').map((p) => p.trim()),
|
ignorePaths: (ignorePaths ?? '').split(',').map((p) => p.trim()),
|
||||||
recursive,
|
recursive,
|
||||||
accessToken: (credentials.accessToken as string) || '',
|
accessToken: (credentials.accessToken as string) || '',
|
||||||
|
apiUrl: credentials.server as string,
|
||||||
});
|
});
|
||||||
|
|
||||||
const loadedDocs = textSplitter
|
const loadedDocs = textSplitter
|
||||||
? await textSplitter.splitDocuments(await docs.load())
|
? await textSplitter.splitDocuments(await docs.load())
|
||||||
: await docs.load();
|
: await docs.load();
|
||||||
|
|
||||||
|
this.addOutputData(NodeConnectionType.AiDocument, index, [[{ json: { loadedDocs } }]]);
|
||||||
return {
|
return {
|
||||||
response: logWrapper(loadedDocs, this),
|
response: logWrapper(loadedDocs, this),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue