Skip to content

Commit 6a72b8a

Browse files
committed
Fix gosec lints
1 parent dfad01f commit 6a72b8a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/release.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ func hotfix() {
100100

101101
// Confirm that the release tag we're cherry-picking onto actually exists and
102102
// is a tag.
103-
runOrDie(exec.Command("git", "rev-parse", "--verify", fmt.Sprintf("%s^{tag}", onto)))
103+
committish := fmt.Sprintf("%s^{tag}", onto)
104+
runOrDie(exec.Command("git", "rev-parse", "--verify", committish))
104105

105106
// Check out the tag that is our starting point. This will put us into a
106107
// "detached HEAD" state, but that's okay, because we're going to explicitly
@@ -145,9 +146,10 @@ func hotfix() {
145146
// commits. This branch may or may not exist already, and it doesn't matter:
146147
// when we push to it, it will either be updated or created, as appropriate.
147148
branch := semver.MajorMinor(onto)
149+
refspec := fmt.Sprintf("HEAD:%s", branch)
148150

149151
if push {
150-
runOrDie(exec.Command("git", "push", "origin", fmt.Sprintf("HEAD:%s", branch), version))
152+
runOrDie(exec.Command("git", "push", "origin", refspec, version))
151153
} else {
152154
fmt.Printf("created tag %s on branch %s, exiting\n", version, branch)
153155
}

0 commit comments

Comments
 (0)