mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
🔀 Merge branch 'feature/github-enterprise-support' of https://github.com/RicardoE105/n8n into RicardoE105-feature/github-enterprise-support
This commit is contained in:
commit
a1d1f994f7
|
@ -3,11 +3,16 @@ import {
|
|||
NodePropertyTypes,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
|
||||
export class GithubApi implements ICredentialType {
|
||||
name = 'githubApi';
|
||||
displayName = 'Github API';
|
||||
properties = [
|
||||
{
|
||||
displayName: 'URL',
|
||||
name: 'url',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
default: 'https://api.github.com',
|
||||
},
|
||||
{
|
||||
displayName: 'User',
|
||||
name: 'user',
|
||||
|
|
|
@ -21,6 +21,7 @@ export async function githubApiRequest(this: IHookFunctions | IExecuteFunctions,
|
|||
if (credentials === undefined) {
|
||||
throw new Error('No credentials got returned!');
|
||||
}
|
||||
const baseUrl = credentials!.url || 'https://api.github.com';
|
||||
|
||||
const options = {
|
||||
method,
|
||||
|
@ -30,7 +31,7 @@ export async function githubApiRequest(this: IHookFunctions | IExecuteFunctions,
|
|||
},
|
||||
body,
|
||||
qs: query,
|
||||
uri: `https://api.github.com${endpoint}`,
|
||||
uri: `${baseUrl}${endpoint}`,
|
||||
json: true
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue