You've already forked go-semantic-release
test(ci services): add test for travis
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
type Travis struct{}
|
||||
|
||||
//Detect if on travis
|
||||
func (t Travis) Detect() (*ProviderConfig, error) {
|
||||
func (t Travis) detect() (*ProviderConfig, error) {
|
||||
|
||||
if _, exists := os.LookupEnv("TRAVIS"); !exists {
|
||||
return nil, fmt.Errorf("not running on travis")
|
||||
@@ -19,11 +19,13 @@ func (t Travis) Detect() (*ProviderConfig, error) {
|
||||
isPR := false
|
||||
|
||||
value := os.Getenv("TRAVIS_PULL_REQUEST")
|
||||
pr := ""
|
||||
|
||||
if value == "false" {
|
||||
log.Debugf("TRAVIS_PULL_REQUEST=%s, not running on pr", value)
|
||||
} else {
|
||||
isPR = true
|
||||
pr = value
|
||||
}
|
||||
|
||||
return &ProviderConfig{
|
||||
@@ -34,6 +36,7 @@ func (t Travis) Detect() (*ProviderConfig, error) {
|
||||
BuildURL: os.Getenv("TRAVIS_BUILD_WEB_URL"),
|
||||
Branch: os.Getenv("TRAVIS_BRANCH"),
|
||||
IsPR: isPR,
|
||||
PR: pr,
|
||||
PRBranch: os.Getenv("TRAVIS_PULL_REQUEST_BRANCH"),
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user