Skip to content

Commit f20a07c

Browse files
Merge pull request #39 from kichristensen/correctCheckForPR
Check if GITHUB_HEAD_REF is empty
2 parents b12b395 + 1e0b12c commit f20a07c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

releases/git.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func getBranchName() string {
9797
func pickBranchName(refs []string) string {
9898
var branch string
9999

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

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

0 commit comments

Comments
 (0)