mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 11:42:43 +01:00
0bfe5eb10b
Add an option to protected branches to add writing deploy keys to the whitelist for pushing. Please note this is technically a breaking change: previously if the owner of a repository was on the whitelist then any writing deploy key was effectively on the whitelist. This option will now need to be set if that is desired. Closes #8472 Details: * Allow Protected Branches to Whitelist Deploy Keys * Add migration * Ensure that IsDeployKey is set to false on the http pushes * add not null default false
18 lines
435 B
Go
18 lines
435 B
Go
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package migrations
|
|
|
|
import (
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
func addWhitelistDeployKeysToBranches(x *xorm.Engine) error {
|
|
type ProtectedBranch struct {
|
|
ID int64
|
|
WhitelistDeployKeys bool `xorm:"NOT NULL DEFAULT false"`
|
|
}
|
|
|
|
return x.Sync2(new(ProtectedBranch))
|
|
}
|