mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Make it possible to get file from specific branch/tag/commit
via GitHub
This commit is contained in:
parent
ba8ccfa3b1
commit
df2c4e99af
|
@ -661,7 +661,34 @@ export class Github implements INodeType {
|
||||||
description: 'Name of the binary property in which to save the binary data of the received file.',
|
description: 'Name of the binary property in which to save the binary data of the received file.',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
displayName: 'Additional Parameters',
|
||||||
|
name: 'additionalParameters',
|
||||||
|
placeholder: 'Add Parameter',
|
||||||
|
description: 'Additional fields to add.',
|
||||||
|
type: 'collection',
|
||||||
|
default: {},
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'get',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'file',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
displayName: 'Reference',
|
||||||
|
name: 'reference',
|
||||||
|
type: 'string',
|
||||||
|
default: '',
|
||||||
|
placeholder: 'master',
|
||||||
|
description: 'The name of the commit/branch/tag. Default: the repository’s default branch (usually master).',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// issue
|
// issue
|
||||||
|
@ -1929,7 +1956,11 @@ export class Github implements INodeType {
|
||||||
requestMethod = 'GET';
|
requestMethod = 'GET';
|
||||||
|
|
||||||
const filePath = this.getNodeParameter('filePath', i) as string;
|
const filePath = this.getNodeParameter('filePath', i) as string;
|
||||||
|
const additionalParameters = this.getNodeParameter('additionalParameters', i) as IDataObject;
|
||||||
|
|
||||||
|
if (additionalParameters.reference) {
|
||||||
|
qs.ref = additionalParameters.reference;
|
||||||
|
}
|
||||||
endpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`;
|
endpoint = `/repos/${owner}/${repository}/contents/${encodeURI(filePath)}`;
|
||||||
}
|
}
|
||||||
} else if (resource === 'issue') {
|
} else if (resource === 'issue') {
|
||||||
|
|
Loading…
Reference in a new issue