From 2aa3b97e51a6f98b7345fbfd91f447ecb1841733 Mon Sep 17 00:00:00 2001 From: Herman Banken Date: Wed, 21 Apr 2021 01:18:25 +0200 Subject: [PATCH] Allow setting the pr title (-pr-title) --- cmd/sync/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/sync/main.go b/cmd/sync/main.go index 4e3342b..696a27c 100644 --- a/cmd/sync/main.go +++ b/cmd/sync/main.go @@ -34,6 +34,7 @@ var ( basePR = flag.String("pr", "", "whether to create a PR, and if set, which branch to set as PR base") baseMerge = flag.String("merge", "", "whether to merge straight away, which branch to set as merge base") prBody = flag.String("pr-body", "Sync", "Body of PR") + prTitle = flag.String("pr-title", "Sync", "Title of PR; defaults to commit message") commitTime = flag.String("commit-timestamp", "now", "Time of the commit; for example $CI_COMMIT_TIMESTAMP of the original commit") dryRun = flag.Bool("dry-run", false, "Do not push, merge, nor PR") // Either use @@ -284,7 +285,7 @@ func Main() { Base: basePR, Draft: refBool(true), Body: prBody, - Title: commitMsg, + Title: refStr(firstStr(*prTitle, *commitMsg)), } pr, _, err := client.PullRequests.Create(ctx, orgName, repoName, &prTemplate) orFatal(err, "creating pr")