Skip to content

Commit

Permalink
add owner/org flag to backport, update readme
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Downs <[email protected]>
  • Loading branch information
briandowns committed Nov 13, 2023
1 parent a77d988 commit 081e2fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/backport/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 -o rancher -r k3s -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 -o k3s-io -r k3s -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 -o rancher -r rke2 -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 -o k3s-io -r k3s -b 'release-1.21,release-1.22' -i 123 -u susejsmith
```

## Contributions
Expand Down
3 changes: 3 additions & 0 deletions cmd/backport/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Note: if a commit is provided, %[2]s utility needs to be ran from either

var (
vers bool
owner string
repo string
commitIDs string
issueID uint
Expand All @@ -62,6 +63,7 @@ func main() {
}

flag.BoolVar(&vers, "v", false, "")
flag.StringVar(&owner, "o", "", "")
flag.StringVar(&repo, "r", "", "")
flag.StringVar(&commitIDs, "c", "", "")
flag.UintVar(&issueID, "i", 0, "")
Expand Down Expand Up @@ -95,6 +97,7 @@ func main() {
client := repository.NewGithub(ctx, ghToken)

pbo := repository.PerformBackportOpts{
Owner: owner,
Repo: repo,
Commits: commits,
IssueID: issueID,
Expand Down

0 comments on commit 081e2fb

Please sign in to comment.