fix:usage error
This commit is contained in:
@@ -6,6 +6,8 @@ import {Api, PullRequest, PullReview} from 'gitea-js'
|
|||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {createCommandManager} from '../pr-collector/gitHelper'
|
import {createCommandManager} from '../pr-collector/gitHelper'
|
||||||
|
import { giteaApi } from 'gitea-js';
|
||||||
|
import fetch from 'cross-fetch';
|
||||||
interface Pulls {
|
interface Pulls {
|
||||||
closed: PullRequest[]
|
closed: PullRequest[]
|
||||||
open: PullRequest[]
|
open: PullRequest[]
|
||||||
@@ -21,11 +23,10 @@ export class GiteaRepository extends BaseRepository {
|
|||||||
constructor(token: string, url: string | undefined, repositoryPath: string) {
|
constructor(token: string, url: string | undefined, repositoryPath: string) {
|
||||||
super(token, url, repositoryPath)
|
super(token, url, repositoryPath)
|
||||||
this.url = url || this.defaultUrl
|
this.url = url || this.defaultUrl
|
||||||
const fetch = require('cross-fetch')
|
|
||||||
const {giteaApi} = require('gitea-js')
|
|
||||||
// @ts-ignore
|
this.api = giteaApi('https://gitea.com/',{
|
||||||
this.api = new giteaApi('https://gitea.com/', {
|
token:token,
|
||||||
token, // generate one at https://gitea.example.com/user/settings/applications
|
|
||||||
customFetch: fetch
|
customFetch: fetch
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user