mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -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.',
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
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
|
||||
|
@ -1929,7 +1956,11 @@ export class Github implements INodeType {
|
|||
requestMethod = 'GET';
|
||||
|
||||
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)}`;
|
||||
}
|
||||
} else if (resource === 'issue') {
|
||||
|
|
Loading…
Reference in a new issue