-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple backports #4
base: main
Are you sure you want to change the base?
Support multiple backports #4
Conversation
When working in large projects with more than one release branch the old code made us write a comment PER branch, resulting in something like: /sudo backport d16-9 /sudo backport xcode12.4 /sudo backport xcode12.5 That is a lot of work and developers are lazy animals. We already supported using more than one branch in the regexp but it resulted in an error later in the script. This commit makes the required changes to ensure that we support several branches. 1. Pares all branches, creates a collection in the params. 2. If only one branhc is used, we create a collection with a single object, else several. 3. We trigger a backport PER branch in a loop using a scriptblock. 4. The exit code is the addition of all the execitions, resulting in 0 if all worked or the number of errors.
action.yml
Outdated
|
||
$parameters = @() | ||
|
||
if ($backportTargetBranch.GetType().Name -eq "String") { # uh, this is ugly, but String also has length and we can iterate, so we need the type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use $backportTargetBranch -is [string]
instead?
Right now, MyLib.String
also matches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a pwsh person ;) looks better, let me test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, works like a charm.
…e/backport-bot-action into support-multiple-backports
When working in large projects with more than one release branch the old
code made us write a comment PER branch, resulting in something like:
/sudo backport d16-9
/sudo backport xcode12.4
/sudo backport xcode12.5
That is a lot of work and developers are lazy animals. We already
supported using more than one branch in the regexp but it resulted in an
error later in the script. This commit makes the required changes to
ensure that we support several branches.
object, else several.
if all worked or the number of errors.