mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 04:40:11 +00:00
@@ -59,10 +59,11 @@ func PostGlobalSecret(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
secret := &model.Secret{
|
||||
Name: in.Name,
|
||||
Value: in.Value,
|
||||
Events: in.Events,
|
||||
Images: in.Images,
|
||||
Name: in.Name,
|
||||
Value: in.Value,
|
||||
Events: in.Events,
|
||||
Images: in.Images,
|
||||
PluginsOnly: in.PluginsOnly,
|
||||
}
|
||||
if err := secret.Validate(); err != nil {
|
||||
c.String(400, "Error inserting global secret. %s", err)
|
||||
@@ -100,6 +101,7 @@ func PatchGlobalSecret(c *gin.Context) {
|
||||
if in.Images != nil {
|
||||
secret.Images = in.Images
|
||||
}
|
||||
secret.PluginsOnly = in.PluginsOnly
|
||||
|
||||
if err := secret.Validate(); err != nil {
|
||||
c.String(400, "Error updating global secret. %s", err)
|
||||
|
@@ -65,11 +65,12 @@ func PostOrgSecret(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
secret := &model.Secret{
|
||||
Owner: owner,
|
||||
Name: in.Name,
|
||||
Value: in.Value,
|
||||
Events: in.Events,
|
||||
Images: in.Images,
|
||||
Owner: owner,
|
||||
Name: in.Name,
|
||||
Value: in.Value,
|
||||
Events: in.Events,
|
||||
Images: in.Images,
|
||||
PluginsOnly: in.PluginsOnly,
|
||||
}
|
||||
if err := secret.Validate(); err != nil {
|
||||
c.String(400, "Error inserting org %q secret. %s", owner, err)
|
||||
@@ -110,6 +111,7 @@ func PatchOrgSecret(c *gin.Context) {
|
||||
if in.Images != nil {
|
||||
secret.Images = in.Images
|
||||
}
|
||||
secret.PluginsOnly = in.PluginsOnly
|
||||
|
||||
if err := secret.Validate(); err != nil {
|
||||
c.String(400, "Error updating org %q secret. %s", owner, err)
|
||||
|
@@ -50,11 +50,12 @@ func PostSecret(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
secret := &model.Secret{
|
||||
RepoID: repo.ID,
|
||||
Name: strings.ToLower(in.Name),
|
||||
Value: in.Value,
|
||||
Events: in.Events,
|
||||
Images: in.Images,
|
||||
RepoID: repo.ID,
|
||||
Name: strings.ToLower(in.Name),
|
||||
Value: in.Value,
|
||||
Events: in.Events,
|
||||
Images: in.Images,
|
||||
PluginsOnly: in.PluginsOnly,
|
||||
}
|
||||
if err := secret.Validate(); err != nil {
|
||||
c.String(400, "Error inserting secret. %s", err)
|
||||
@@ -95,6 +96,7 @@ func PatchSecret(c *gin.Context) {
|
||||
if in.Images != nil {
|
||||
secret.Images = in.Images
|
||||
}
|
||||
secret.PluginsOnly = in.PluginsOnly
|
||||
|
||||
if err := secret.Validate(); err != nil {
|
||||
c.String(400, "Error updating secret. %s", err)
|
||||
|
Reference in New Issue
Block a user