Skip to content

Commit 3abd56a

Browse files
author
Cameron Motevasselani
committed
fix(gha): cleanup baseBranch string
1 parent d557496 commit 3abd56a

File tree

1 file changed

+4
-2
lines changed
  • src/main/kotlin/io/spinnaker/bumpdeps

1 file changed

+4
-2
lines changed

src/main/kotlin/io/spinnaker/bumpdeps/Main.kt

+4-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class BumpDeps : CliktCommand() {
3535

3636
companion object {
3737
const val REF_PREFIX = "refs/tags/v"
38+
const val BRANCH_PREFIX = "origin/"
3839
const val GITHUB_OAUTH_TOKEN_ENV_NAME = "GITHUB_OAUTH"
3940
const val MAVEN_REPO_USERNAME_ENV_NAME = "NEXUS_USERNAME"
4041
const val MAVEN_REPO_PASSWORD_ENV_NAME = "NEXUS_PASSWORD"
@@ -65,8 +66,9 @@ class BumpDeps : CliktCommand() {
6566
.convert { convertReviewersArg(it) }
6667
.default(Reviewers(), defaultForHelp = "")
6768

68-
private val baseBranch by option(help = "the name of the branch to target in pull requests")
69-
.default(BASE_BRANCH)
69+
private val baseBranch by option(help = "the name of the branch to target in pull requests").convert { ref ->
70+
ref.trim().removePrefix(BRANCH_PREFIX)
71+
}.required()
7072

7173
private val oauthToken by lazy {
7274
System.getenv(GITHUB_OAUTH_TOKEN_ENV_NAME)

0 commit comments

Comments
 (0)