From 1c422fad2b6eaadd5d410d566a5aa0e565218c17 Mon Sep 17 00:00:00 2001 From: Vitor Date: Mon, 13 Nov 2023 15:07:22 -0300 Subject: [PATCH] Adding owner flag Signed-off-by: Vitor --- cmd/backport/README.md | 8 ++++---- cmd/backport/main.go | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/backport/README.md b/cmd/backport/README.md index 498667e2..8a80cbae 100644 --- a/cmd/backport/README.md +++ b/cmd/backport/README.md @@ -8,16 +8,16 @@ If a commit is provided, `backport` assumes you're running from the repository t ```sh # Backport K3s change into release-1.21 and release-1.22. Only create the backport issues. -./backport -r k3s -b 'release-1.21,release-1.22' -i 123 +./backport -r k3s -o k3s-io -b 'release-1.21,release-1.22' -i 123 # Backport K3s change into release-1.21 and release-1.22. Creates the backport issues and cherry-picks the given commit id. -./backport -r k3s -b 'release-1.21,release-1.22' -i 123 -c '181210f8f9c779c26da1d9b2075bde0127302ee0' +./backport -r k3s -o k3s-io -b 'release-1.21,release-1.22' -i 123 -c '181210f8f9c779c26da1d9b2075bde0127302ee0' # Backport RKE2 change into release-1.20, release-1.21 and release-1.22 -./backport -r rke2 -b 'release-1.20,release-1.21,release-1.22' -i 456 -c 'cd700d9a444df8f03b8ce88cb90261ed1bc49f27' +./backport -r rke2 -o rancher -b 'release-1.20,release-1.21,release-1.22' -i 456 -c 'cd700d9a444df8f03b8ce88cb90261ed1bc49f27' # Backport K3s change into release-1.21 and release-1.22 and assign to given user. -./backport -r k3s -b 'release-1.21,release-1.22' -i 123 -u susejsmith +./backport -r k3s -o k3s-io -b 'release-1.21,release-1.22' -i 123 -u susejsmith ``` ## Contributions diff --git a/cmd/backport/main.go b/cmd/backport/main.go index 36a26e44..92911738 100644 --- a/cmd/backport/main.go +++ b/cmd/backport/main.go @@ -47,6 +47,7 @@ var ( issueID uint branches string user string + owner string ) func main() { @@ -67,6 +68,7 @@ func main() { flag.UintVar(&issueID, "i", 0, "") flag.StringVar(&branches, "b", "", "") flag.StringVar(&user, "u", "", "") + flag.StringVar(&owner, "o", "", "") flag.Parse() if vers { @@ -100,6 +102,7 @@ func main() { IssueID: issueID, Branches: branches, User: user, + Owner: owner, } issues, err := repository.PerformBackport(ctx, client, &pbo) if err != nil {