Feat: GitHub connector (#12314)

### What problem does this PR solve?

Feat: GitHub connector

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Magicbook1108
2025-12-30 15:09:52 +08:00
committed by GitHub
parent f0392e7501
commit 5903d1c8f1
21 changed files with 1522 additions and 49 deletions

View File

@ -27,6 +27,7 @@ export enum DataSourceKey {
AIRTABLE = 'airtable',
GITLAB = 'gitlab',
ASANA = 'asana',
GITHUB = 'github',
// SHAREPOINT = 'sharepoint',
// SLACK = 'slack',
// TEAMS = 'teams',
@ -121,6 +122,11 @@ export const generateDataSourceInfo = (t: TFunction) => {
description: t(`setting.${DataSourceKey.ASANA}Description`),
icon: <SvgIcon name={'data-source/asana'} width={38} />,
},
[DataSourceKey.GITHUB]: {
name: 'GitHub',
description: t(`setting.${DataSourceKey.GITHUB}Description`),
icon: <SvgIcon name={'data-source/github'} width={38} />,
},
};
};
@ -738,6 +744,40 @@ export const DataSourceFormFields = {
required: false,
},
],
[DataSourceKey.GITHUB]: [
{
label: 'Repository Owner',
name: 'config.repository_owner',
type: FormFieldType.Text,
required: true,
},
{
label: 'Repository Name',
name: 'config.repository_name',
type: FormFieldType.Text,
required: true,
},
{
label: 'GitHub Access Token',
name: 'config.credentials.github_access_token',
type: FormFieldType.Password,
required: true,
},
{
label: 'Inlcude Pull Requests',
name: 'config.include_pull_requests',
type: FormFieldType.Checkbox,
required: false,
defaultValue: false,
},
{
label: 'Inlcude Issues',
name: 'config.include_issues',
type: FormFieldType.Checkbox,
required: false,
defaultValue: false,
},
],
};
export const DataSourceFormDefaultValues = {
@ -964,4 +1004,17 @@ export const DataSourceFormDefaultValues = {
},
},
},
[DataSourceKey.GITHUB]: {
name: '',
source: DataSourceKey.GITHUB,
config: {
repository_owner: '',
repository_name: '',
include_pull_requests: false,
include_issues: false,
credentials: {
github_access_token: '',
},
},
},
};