diff --git a/packages/nodes-base/nodes/Github/Github.node.ts b/packages/nodes-base/nodes/Github/Github.node.ts index 2e29b467ca..e2df4ac494 100644 --- a/packages/nodes-base/nodes/Github/Github.node.ts +++ b/packages/nodes-base/nodes/Github/Github.node.ts @@ -340,6 +340,12 @@ export class Github implements INodeType { description: 'Get a release', action: 'Get a release', }, + { + name: 'Get by Tag', + value: 'getByTag', + description: 'Get a release by Tag', + action: 'Get a release by Tag', + }, { name: 'Get Many', value: 'getAll', @@ -1273,6 +1279,13 @@ export class Github implements INodeType { default: false, description: 'Whether to point out that the release is non-production ready', }, + { + displayName: 'Latest', + name: 'make_latest', + type: 'boolean', + default: true, + description: 'Whether to mark the release as latest or not', + }, { displayName: 'Target Commitish', name: 'target_commitish', @@ -1351,6 +1364,13 @@ export class Github implements INodeType { default: false, description: 'Whether to point out that the release is non-production ready', }, + { + displayName: 'Latest', + name: 'make_latest', + type: 'boolean', + default: true, + description: 'Whether to mark the release as latest or not', + }, { displayName: 'Tag Name', name: 'tag_name', @@ -1402,6 +1422,23 @@ export class Github implements INodeType { default: 50, description: 'Max number of results to return', }, + // ---------------------------------- + // release:getByTag + // ---------------------------------- + { + displayName: 'Tag Name', + name: 'tag_name', + type: 'string', + required: true, + displayOptions: { + show: { + resource: ['release'], + operation: ['getByTag'], + }, + }, + default: '', + description: 'Release Tag Name', + }, // ---------------------------------- // repository @@ -2031,6 +2068,7 @@ export class Github implements INodeType { 'repository:listReferrers', 'user:getRepositories', 'release:getAll', + 'release:getByTag', 'review:getAll', 'organization:getRepositories', ]; @@ -2307,6 +2345,16 @@ export class Github implements INodeType { qs.per_page = this.getNodeParameter('limit', 0); } } + if (operation === 'getByTag') { + // ---------------------------------- + // getbyTag + // ---------------------------------- + + requestMethod = 'GET'; + const tagName = this.getNodeParameter('tag_name', i) as string; + + endpoint = `/repos/${owner}/${repository}/releases/tags/${tagName}`; + } if (operation === 'update') { // ---------------------------------- // update