mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-23 08:56:29 +00:00
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)
|
||||
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",
|
||||
|
|
Loading…
Reference in a new issue