mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-12-04 15:21:05 +01:00
Correctly update environment secrets
This commit is contained in:
parent
f9746215ef
commit
3b156a59b9
@ -50,11 +50,18 @@ func updateEnvironmentSecrets(store db.Store, env db.Environment) error {
|
||||
continue
|
||||
}
|
||||
|
||||
err = store.UpdateAccessKey(db.AccessKey{
|
||||
Name: string(secret.Type) + "." + secret.Name,
|
||||
String: secret.Secret,
|
||||
Type: db.AccessKeyString,
|
||||
})
|
||||
updateKey := db.AccessKey{
|
||||
ID: key.ID,
|
||||
ProjectID: key.ProjectID,
|
||||
Name: string(secret.Type) + "." + secret.Name,
|
||||
Type: db.AccessKeyString,
|
||||
}
|
||||
if secret.Secret != "" {
|
||||
updateKey.String = secret.Secret
|
||||
updateKey.OverrideSecret = true
|
||||
}
|
||||
|
||||
err = store.UpdateAccessKey(updateKey)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user