mirror of
https://code.forgejo.org/actions/git-backporting.git
synced 2025-05-18 19:49:13 -04:00
feat: add --git-client to explicitly set the type of forge (#106)
codeberg is running Forgejo and it may not be possible to infer that from the URL alone. The same is true for GitHub Enterprise Server.
This commit is contained in:
parent
646d8fe41c
commit
80a0b554f0
11 changed files with 70 additions and 3 deletions
|
@ -60,7 +60,12 @@ export default class Runner {
|
|||
}
|
||||
|
||||
// 2. init git service
|
||||
const gitClientType: GitClientType = inferGitClient(args.pullRequest);
|
||||
let gitClientType: GitClientType;
|
||||
if (args.gitClient === undefined) {
|
||||
gitClientType = inferGitClient(args.pullRequest);
|
||||
} else {
|
||||
gitClientType = args.gitClient as GitClientType;
|
||||
}
|
||||
// the api version is ignored in case of github
|
||||
const apiUrl = inferGitApiUrl(args.pullRequest, gitClientType === GitClientType.CODEBERG ? "v1" : undefined);
|
||||
const token = this.fetchToken(args, gitClientType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue