mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-06-06 01:18:50 +00:00
Merge pull request #1826 from donny-dont/feature/skip_verify_implementation
Implementing SkipVerify support for secrets [ci skip]
This commit is contained in:
commit
de0d707501
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