You've already forked go-semantic-release
fix(ci): remove refs/heads/ from branch
This commit is contained in:
@@ -2,6 +2,7 @@ package ci
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
@@ -26,11 +27,17 @@ func (t GithubActions) detect(envs map[string]string) (*ProviderConfig, error) {
|
||||
log.Debugf("GITHUB_EVENT_NAME=%s, not running on pr", value)
|
||||
}
|
||||
|
||||
branch := envs["GITHUB_REF"]
|
||||
|
||||
if strings.HasPrefix(envs["GITHUB_REF"], "refs/heads/") {
|
||||
branch = strings.Replace(branch, "refs/heads/", "", 1)
|
||||
}
|
||||
|
||||
return &ProviderConfig{
|
||||
Service: "GithubActions",
|
||||
Name: "GithubActions CI",
|
||||
Commit: envs["GITHUB_SHA"],
|
||||
Branch: envs["GITHUB_REF"],
|
||||
Branch: branch,
|
||||
IsPR: isPR,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user