mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-21 19:25:46 +08:00
fix: token
This commit is contained in:
@@ -7,17 +7,16 @@ export class IssueCoreEngine implements IIssueCoreEngine {
|
||||
private owner!: string;
|
||||
private repo!: string;
|
||||
private issueNumber!: number;
|
||||
private githubToken!: string;
|
||||
|
||||
private octokit!: Octokit;
|
||||
|
||||
public constructor(_info: IIssueBaseInfo) {
|
||||
if (_info.owner && _info.repo && _info.githubToken) {
|
||||
Object.assign(this, _info);
|
||||
const octokit = new Octokit({ auth: `token ${this.githubToken}` });
|
||||
this.octokit = octokit;
|
||||
if (_info.owner && _info.repo) {
|
||||
this.owner = _info.owner;
|
||||
this.repo = _info.repo;
|
||||
this.issueNumber = _info.issueNumber;
|
||||
this.octokit = new Octokit({ auth: `token ${_info.token}` });
|
||||
} else {
|
||||
console && console.error && console.error(`Init failed, need owner、repo and token!`);
|
||||
console && console.error && console.error(`Init failed, need owner、repo!`);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -4,7 +4,7 @@ export interface IIssueBaseInfo {
|
||||
owner: string;
|
||||
repo: string;
|
||||
issueNumber: number;
|
||||
githubToken: string;
|
||||
token?: string | void;
|
||||
}
|
||||
|
||||
export interface IListIssuesParams {
|
||||
|
Reference in New Issue
Block a user