mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-07-01 23:23:46 +00:00
feat: add --cherry-pick-options to add to all cherry-pick run (#116)
Fixes: https://github.com/kiegroup/git-backporting/issues/111
This commit is contained in:
parent
53cc505f17
commit
fe6be83074
18 changed files with 179 additions and 81 deletions
|
@ -46,6 +46,7 @@ export default abstract class ArgsParser {
|
|||
squash: this.getOrDefault(args.squash, true),
|
||||
strategy: this.getOrDefault(args.strategy),
|
||||
strategyOption: this.getOrDefault(args.strategyOption),
|
||||
cherryPickOptions: this.getOrDefault(args.cherryPickOptions),
|
||||
comments: this.getOrDefault(args.comments)
|
||||
};
|
||||
}
|
||||
|
|
|
@ -25,5 +25,6 @@ export interface Args {
|
|||
squash?: boolean, // if false use squashed/merged commit otherwise backport all commits as part of the pr
|
||||
strategy?: string, // cherry-pick merge strategy
|
||||
strategyOption?: string, // cherry-pick merge strategy option
|
||||
cherryPickOptions?: string, // additional cherry-pick options
|
||||
comments?: string[], // additional comments to be posted
|
||||
}
|
|
@ -31,6 +31,7 @@ export default class CLIArgsParser extends ArgsParser {
|
|||
.option("--no-squash", "if provided the tool will backport all commits as part of the pull request")
|
||||
.option("--strategy <strategy>", "cherry-pick merge strategy, default to 'recursive'", undefined)
|
||||
.option("--strategy-option <strategy-option>", "cherry-pick merge strategy option, default to 'theirs'")
|
||||
.option("--cherry-pick-options <options>", "additional cherry-pick options")
|
||||
.option("--comments <comments>", "semicolon separated list of additional comments to be posted to the backported pull request", getAsSemicolonSeparatedList)
|
||||
.option("-cf, --config-file <config-file>", "configuration file containing all valid options, the json must match Args interface");
|
||||
}
|
||||
|
@ -67,6 +68,7 @@ export default class CLIArgsParser extends ArgsParser {
|
|||
squash: opts.squash,
|
||||
strategy: opts.strategy,
|
||||
strategyOption: opts.strategyOption,
|
||||
cherryPickOptions: opts.cherryPickOptions,
|
||||
comments: opts.comments,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ export default class GHAArgsParser extends ArgsParser {
|
|||
squash: !getAsBooleanOrDefault(getInput("no-squash")),
|
||||
strategy: getOrUndefined(getInput("strategy")),
|
||||
strategyOption: getOrUndefined(getInput("strategy-option")),
|
||||
cherryPickOptions: getOrUndefined(getInput("cherry-pick-options")),
|
||||
comments: getAsSemicolonSeparatedList(getInput("comments")),
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue