diff --git a/pipeline/s3/s3.go b/pipeline/s3/s3.go index 26e08b7bd..1e94a271a 100644 --- a/pipeline/s3/s3.go +++ b/pipeline/s3/s3.go @@ -64,10 +64,12 @@ func upload(ctx *context.Context, conf config.S3) error { awsConfig.Endpoint = aws.String(conf.Endpoint) awsConfig.S3ForcePathStyle = aws.Bool(true) } - // TODO: add a test for this - if conf.Profile != "" { - awsConfig.Credentials = credentials.NewSharedCredentials("", conf.Profile) - } + awsConfig.Credentials = credentials.NewChainCredentials([]credentials.Provider{ + &credentials.EnvProvider{}, + &credentials.SharedCredentialsProvider{ + Profile: conf.Profile, + }, + }) sess := session.Must(session.NewSession(awsConfig)) svc := s3.New(sess, &aws.Config{ Region: aws.String(conf.Region),