Merge branch 'master' of github.com:Nightapes/go-semantic-release into remove/draft

This commit is contained in:
fwiedmann
2019-08-22 00:12:24 +02:00
parent 2eb64f153a
commit a2fc03c64d
10 changed files with 128 additions and 19 deletions

View File

@@ -49,11 +49,9 @@ func NewAddHeaderTransport(T http.RoundTripper, key, value string) *AddHeaderTra
}
// GetAccessToken lookup for the providers accesstoken
func GetAccessToken(providerName string) (string, error) {
func GetAccessToken(envName string) (string, error) {
var token string
var exists bool
envName := fmt.Sprintf("%s_ACCESS_TOKEN", strings.ToUpper(providerName))
log.Debugf("check if %s environment variable is set", envName)
if token, exists = os.LookupEnv(envName); !exists {

View File

@@ -43,7 +43,7 @@ func TestGetAccessToken(t *testing.T) {
fmt.Println(err.Error())
}
_, err := util.GetAccessToken(testObject.providerName)
_, err := util.GetAccessToken(envName)
assert.Equal(t, testObject.valid, err == nil)
os.Unsetenv(envName)
@@ -193,7 +193,7 @@ func TestDoAndRoundTrip(t *testing.T) {
hasError: true,
responseBody: &example{},
responseBodyType: &example{},
path: "broken",
path: "4/broken",
},
}