fix(Github Node): Fix fetch of file names with ? character (#12206)

This commit is contained in:
Mariana-na 2024-12-16 15:15:12 +00:00 committed by GitHub
parent 80eea49cf0
commit 39462abe1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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') {