Skip to content

Commit

Permalink
Fix gosec lints
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongable committed Mar 10, 2023
1 parent dfad01f commit 6a72b8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ func hotfix() {

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

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

if push {
runOrDie(exec.Command("git", "push", "origin", fmt.Sprintf("HEAD:%s", branch), version))
runOrDie(exec.Command("git", "push", "origin", refspec, version))
} else {
fmt.Printf("created tag %s on branch %s, exiting\n", version, branch)
}
Expand Down

0 comments on commit 6a72b8a

Please sign in to comment.