Skip to content

Commit 79209d5

Browse files
author
sunlei
committed
validate github datasource
1 parent 823ecb8 commit 79209d5

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

  • server/node-service/src/plugins/github

server/node-service/src/plugins/github/index.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,20 @@ const spec = readYaml(path.join(__dirname, "./gitHub.spec.yaml"));
1111
const dataSourceConfig = {
1212
type: "dataSource",
1313
params: [
14-
{
15-
type: "groupTitle",
16-
key: "ApiKey",
17-
label: "HTTP Basic Auth",
18-
},
1914
{
2015
type: "textInput",
2116
key: "ApiKey.username",
2217
label: "Username",
23-
tooltip: "Basic auth username",
24-
placeholder: "<Basic Auth Username>",
18+
tooltip: "The username of your GitHub account.",
19+
placeholder: "<Your GitHub username>",
2520
},
2621
{
2722
type: "password",
2823
key: "ApiKey.password",
2924
label: "Password",
30-
tooltip: "Basic auth password",
31-
placeholder: "<Basic Auth Password>",
25+
tooltip:
26+
"[Document](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) about how to create a personal access token",
27+
placeholder: "<Your Personal Access Token>",
3228
},
3329
],
3430
} as const;
@@ -62,7 +58,7 @@ const gitHubPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
6258
run: function (actionData, dataSourceConfig): Promise<any> {
6359
const runApiDsConfig = {
6460
url: "",
65-
serverURL: "",
61+
serverURL: "https://api.github.com",
6662
dynamicParamsConfig: dataSourceConfig,
6763
};
6864
return runOpenApi(actionData, runApiDsConfig, spec as OpenAPIV3.Document);

0 commit comments

Comments
 (0)