Skip to content

Commit

Permalink
- better handle homeUrl for enterprise instances with different urls …
Browse files Browse the repository at this point in the history
…(used by replace pattern for comparison string)
  • Loading branch information
mikepenz authored Nov 5, 2023
1 parent 8afbd5a commit 2538eab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/repositories/GiteaRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export class GiteaRepository extends BaseRepository {
return 'https://gitea.com'
}

get homeUrl(): string {
return 'https://gitea.com'
}

constructor(token: string, url: string | undefined, repositoryPath: string) {
super(token, url, repositoryPath)
this.url = url || this.defaultUrl
Expand Down Expand Up @@ -237,8 +241,4 @@ export class GiteaRepository extends BaseRepository {
core.info(`ℹ️ Found ${tagsInfo.length} (fetching max: ${maxTagsToFetch}) tags from the GitHub API for ${owner}/${repo}`)
return tagsInfo
}

get homeUrl(): string {
return 'https://gitea.com'
}
}
7 changes: 4 additions & 3 deletions src/repositories/GithubRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ export class GithubRepository extends BaseRepository {
return 'https://api.github.com'
}

get homeUrl(): string {
return this.url?.replace('api.', '') || 'https://github.com'
}

private octokit: Octokit

constructor(token: string, url: string | undefined, repositoryPath: string) {
Expand Down Expand Up @@ -297,7 +301,4 @@ export class GithubRepository extends BaseRepository {
}
return false
}
get homeUrl(): string {
return 'https://github.com'
}
}

0 comments on commit 2538eab

Please sign in to comment.