Skip to content

Commit

Permalink
Merge pull request #39 from kichristensen/correctCheckForPR
Browse files Browse the repository at this point in the history
Check if GITHUB_HEAD_REF is empty
  • Loading branch information
kichristensen committed May 16, 2024
2 parents b12b395 + 1e0b12c commit f20a07c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions releases/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func getBranchName() string {
func pickBranchName(refs []string) string {
var branch string

if b, ok := os.LookupEnv("GITHUB_HEAD_REF"); ok {
if b, ok := os.LookupEnv("GITHUB_HEAD_REF"); ok && b != "" {
// pull request
branch = b
} else if b, ok := os.LookupEnv("GITHUB_REF"); ok && !strings.HasPrefix(b, "refs/tags/") {
Expand Down Expand Up @@ -138,7 +138,7 @@ func pickBranchName(refs []string) string {

func getPermalink() (string, bool) {
// Use dev for pull requests
if _, pr := os.LookupEnv("GITHUB_HEAD_REF"); pr {
if ref, ok := os.LookupEnv("GITHUB_HEAD_REF"); ok && ref != "" {
return "dev", false
}

Expand Down

0 comments on commit f20a07c

Please sign in to comment.