Allow to use env vars in config

This commit is contained in:
Mikołaj Pęczkowski 2021-11-03 18:20:28 +01:00
parent 5e6a5e23fd
commit 2b4c6d3318
4 changed files with 35 additions and 28 deletions

View file

@ -3,6 +3,7 @@ package config
import (
"errors"
"fmt"
"os"
"strings"
"gopkg.in/yaml.v3"
@ -13,6 +14,8 @@ func GetRepositoryConfig(data []byte, fileExtension string) (Configuration, erro
var config Configuration
var err error
data = []byte(os.ExpandEnv(string(data)))
switch fileExtension {
case "yaml":
err = yaml.Unmarshal(data, &config)