Implement skip verify for secrets
This commit is contained in:
parent
db5b8e83ee
commit
3968195168
1 changed files with 8 additions and 4 deletions
|
@ -94,13 +94,17 @@ func (a *Agent) prep(w *model.Work) (*yaml.Config, error) {
|
||||||
envs := toEnv(w)
|
envs := toEnv(w)
|
||||||
w.Yaml = expander.ExpandString(w.Yaml, envs)
|
w.Yaml = expander.ExpandString(w.Yaml, envs)
|
||||||
|
|
||||||
// inject the netrc file into the clone plugin if the repository is
|
// append secrets when verified or when a secret does not require
|
||||||
// private and requires authentication.
|
// verification
|
||||||
var secrets []*model.Secret
|
var secrets []*model.Secret
|
||||||
if w.Verified {
|
for _, secret := range w.Secrets {
|
||||||
secrets = append(secrets, 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 {
|
if w.Repo.IsPrivate {
|
||||||
secrets = append(secrets, &model.Secret{
|
secrets = append(secrets, &model.Secret{
|
||||||
Name: "DRONE_NETRC_USERNAME",
|
Name: "DRONE_NETRC_USERNAME",
|
||||||
|
|
Loading…
Reference in a new issue