mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-07-19 04:58:24 +02:00
feat(gh-85): take git tokens from environment (#88)
This commit is contained in:
parent
aac73bf7c5
commit
70da575afc
17 changed files with 456 additions and 24 deletions
|
@ -33,9 +33,19 @@ export default class PullRequestConfigsParser extends ConfigsParser {
|
|||
throw new Error(`The number of backport branch names, if provided, must match the number of target branches or just one, provided ${bpBranchNames.length} branch names instead`);
|
||||
}
|
||||
|
||||
// setup the auth token
|
||||
let token = args.auth;
|
||||
if (token === undefined) {
|
||||
this.logger.info("Auth argument not provided, checking available tokens from env..");
|
||||
token = this.getGitTokenFromEnv(this.gitClient.getClientType());
|
||||
if (!token) {
|
||||
this.logger.info("Git token not set in the env");
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
dryRun: args.dryRun!,
|
||||
auth: args.auth,
|
||||
auth: token,
|
||||
folder: `${folder.startsWith("/") ? "" : process.cwd() + "/"}${args.folder ?? this.getDefaultFolder()}`,
|
||||
mergeStrategy: args.strategy,
|
||||
mergeStrategyOption: args.strategyOption,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue