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:
Earl Warren 2024-03-23 17:13:14 +01:00 committed by GitHub
parent 646d8fe41c
commit 80a0b554f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 70 additions and 3 deletions

View file

@ -14,6 +14,7 @@ export default class CLIArgsParser extends ArgsParser {
.option("-pr, --pull-request <pr-url>", "pull request url, e.g., https://github.com/kiegroup/git-backporting/pull/1")
.option("-d, --dry-run", "if enabled the tool does not create any pull request nor push anything remotely")
.option("-a, --auth <auth>", "git authentication string, if not provided fallback by looking for existing env variables like GITHUB_TOKEN")
.option("--git-client <github|gitlab|codeberg>", "git client type, if not set it is infered from --pull-request")
.option("-gu, --git-user <git-user>", "local git user name, default is 'GitHub'")
.option("-ge, --git-email <git-email>", "local git user email, default is 'noreply@github.com'")
.option("-f, --folder <folder>", "local folder where the repo will be checked out, e.g., /tmp/folder")
@ -49,6 +50,7 @@ export default class CLIArgsParser extends ArgsParser {
pullRequest: opts.pullRequest,
targetBranch: opts.targetBranch,
folder: opts.folder,
gitClient: opts.gitClient,
gitUser: opts.gitUser,
gitEmail: opts.gitEmail,
title: opts.title,