mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Github Document Loader Node): Pass through apiUrl from credentials & fix log output (#11049)
This commit is contained in:
@@ -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),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user