mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-30 08:06:52 +02:00
update secret interpolation
This commit is contained in:
parent
cbeac5e671
commit
f51a9aed84
@ -97,7 +97,7 @@ func (a *Agent) prep(w *model.Work) (*yaml.Config, error) {
|
||||
envSecrets := map[string]string{}
|
||||
if os.Getenv("DRONE_INTERPOLATE_SECRETS") != "" {
|
||||
for _, secret := range w.Secrets {
|
||||
if w.Verified || secret.SkipVerify {
|
||||
if (w.Verified || secret.SkipVerify) && secret.MatchEvent(w.Build.Event) {
|
||||
envSecrets[secret.Name] = secret.Value
|
||||
}
|
||||
}
|
||||
@ -109,9 +109,6 @@ func (a *Agent) prep(w *model.Work) (*yaml.Config, error) {
|
||||
if !ok {
|
||||
env, ok = envs[s]
|
||||
}
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
if strings.Contains(env, "\n") {
|
||||
env = fmt.Sprintf("%q", env)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user