Implement skip verify for secrets

This commit is contained in:
Don 2016-10-24 10:55:54 -07:00
parent db5b8e83ee
commit 3968195168

View file

@ -94,13 +94,17 @@ func (a *Agent) prep(w *model.Work) (*yaml.Config, error) {
envs := toEnv(w)
w.Yaml = expander.ExpandString(w.Yaml, envs)
// inject the netrc file into the clone plugin if the repository is
// private and requires authentication.
// append secrets when verified or when a secret does not require
// verification
var secrets []*model.Secret
if w.Verified {
secrets = append(secrets, w.Secrets...)
for _, secret := range w.Secrets {
if w.Verified || secret.SkipVerify {
secrets = append(secrets, secret)
}
}
// inject the netrc file into the clone plugin if the repository is
// private and requires authentication.
if w.Repo.IsPrivate {
secrets = append(secrets, &model.Secret{
Name: "DRONE_NETRC_USERNAME",