fix(github): use env GITHUB_TOKEN for releaser

This commit is contained in:
Nightapes
2019-08-21 21:06:57 +02:00
parent 2f2f7e51fb
commit 115964c9c1
6 changed files with 17 additions and 16 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)