You've already forked go-semantic-release
feat(releaser): add git only as releaser, will create a new tag with version only
This commit is contained in:
@@ -39,13 +39,13 @@ func ReadAllEnvs() map[string]string {
|
||||
}
|
||||
|
||||
//GetCIProvider get provider
|
||||
func GetCIProvider(gitUtil *gitutil.GitUtil, envs map[string]string) (*ProviderConfig, error) {
|
||||
func GetCIProvider(gitUtil *gitutil.GitUtil, configCheck bool, envs map[string]string) (*ProviderConfig, error) {
|
||||
|
||||
services := []Service{
|
||||
Travis{},
|
||||
GithubActions{},
|
||||
GitlabCI{},
|
||||
Git{gitUtil: gitUtil}, // GIt must be the last option to check
|
||||
Git{gitUtil: gitUtil}, // Git must be the last option to check
|
||||
}
|
||||
|
||||
for _, service := range services {
|
||||
@@ -57,5 +57,9 @@ func GetCIProvider(gitUtil *gitutil.GitUtil, envs map[string]string) (*ProviderC
|
||||
}
|
||||
log.Debugf("%s", err.Error())
|
||||
}
|
||||
return nil, fmt.Errorf("could not find any CI, if running locally set env CI=true")
|
||||
if configCheck {
|
||||
return nil, fmt.Errorf("could not find any CI, if running locally set env CI=true")
|
||||
|
||||
}
|
||||
return Git{gitUtil: gitUtil}.detect(map[string]string{"CI": "true"})
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ func TestCi(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, config := range testConfigs {
|
||||
provider, err := ci.GetCIProvider(gitUtilInMemory, config.envs)
|
||||
provider, err := ci.GetCIProvider(gitUtilInMemory, true, config.envs)
|
||||
assert.Equalf(t, config.hasError, err != nil, "Service %s should have error: %t -> %s", config.service, config.hasError, err)
|
||||
assert.Equalf(t, config.result, provider, "Service %s should have provider", config.service)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user