- improve formatting
- add some more comments
This commit is contained in:
@@ -12,7 +12,9 @@ export abstract class BaseRepository {
|
||||
// Define an abstract getter for the default URL
|
||||
abstract get defaultUrl(): string
|
||||
|
||||
// Define the abstract getter for the home URL (also used for some replace patterns)
|
||||
abstract get homeUrl(): string
|
||||
|
||||
protected constructor(
|
||||
protected token: string,
|
||||
protected url: string | undefined,
|
||||
|
||||
@@ -6,6 +6,7 @@ import {Api, PullRequest, PullReview, giteaApi} from 'gitea-js'
|
||||
import moment from 'moment'
|
||||
import * as core from '@actions/core'
|
||||
import {createCommandManager} from '../pr-collector/gitHelper'
|
||||
|
||||
interface Pulls {
|
||||
closed: PullRequest[]
|
||||
open: PullRequest[]
|
||||
@@ -85,6 +86,10 @@ export class GiteaRepository extends BaseRepository {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* WARNING: This does not actually get the diff from the remote, as Gitea does not offer a compareable API.
|
||||
* This uses the local repository to get the diff. NOTE: As such, gitea integration requires the repo available.
|
||||
*/
|
||||
async getDiffRemote(owner: string, repo: string, base: string, head: string): Promise<DiffInfo> {
|
||||
let changedFilesCount = 0
|
||||
let additionCount = 0
|
||||
@@ -223,7 +228,7 @@ export class GiteaRepository extends BaseRepository {
|
||||
})
|
||||
|
||||
async getTags(owner: string, repo: string, maxTagsToFetch: number): Promise<TagInfo[]> {
|
||||
core.debug(`start to get gitea tag `)
|
||||
core.debug(`Start to get tag from gitea`)
|
||||
const response = await this.api.repos.repoListTags(owner, repo, {
|
||||
limit: maxTagsToFetch
|
||||
})
|
||||
|
||||
@@ -288,6 +288,7 @@ export class GithubRepository extends BaseRepository {
|
||||
body: comment.body,
|
||||
state: comment.state
|
||||
})
|
||||
|
||||
private fetchedEnough(pullRequests: PullsListData, fromDate: moment.Moment): boolean {
|
||||
for (let i = 0; i < Math.min(pullRequests.length, 3); i++) {
|
||||
const firstPR = pullRequests[i]
|
||||
|
||||
Reference in New Issue
Block a user