From 39462abe1fde7e82b5e5b8f3ceebfcadbfd7c925 Mon Sep 17 00:00:00 2001 From: Mariana-na <135712885+Mariana-na@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:15:12 +0000 Subject: [PATCH] fix(Github Node): Fix fetch of file names with ? character (#12206) --- packages/nodes-base/nodes/Github/Github.node.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nodes-base/nodes/Github/Github.node.ts b/packages/nodes-base/nodes/Github/Github.node.ts index 2e29b467ca..cbbfe62331 100644 --- a/packages/nodes-base/nodes/Github/Github.node.ts +++ b/packages/nodes-base/nodes/Github/Github.node.ts @@ -2128,7 +2128,7 @@ export class Github implements INodeType { } } - endpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`; + endpoint = `/repos/${owner}/${repository}/contents/${encodeURIComponent(filePath)}`; } else if (operation === 'delete') { // ---------------------------------- // delete @@ -2165,7 +2165,7 @@ export class Github implements INodeType { body.branch as string | undefined, ); - endpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`; + endpoint = `/repos/${owner}/${repository}/contents/${encodeURIComponent(filePath)}`; } else if (operation === 'get') { requestMethod = 'GET'; @@ -2179,11 +2179,11 @@ export class Github implements INodeType { qs.ref = additionalParameters.reference; } - endpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`; + endpoint = `/repos/${owner}/${repository}/contents/${encodeURIComponent(filePath)}`; } else if (operation === 'list') { requestMethod = 'GET'; const filePath = this.getNodeParameter('filePath', i); - endpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`; + endpoint = `/repos/${owner}/${repository}/contents/${encodeURIComponent(filePath)}`; } } else if (resource === 'issue') { if (operation === 'create') {