// Copyright 2026 The MokoGitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package v1_27

import "xorm.io/xorm"

// AddActionsUserWhitelistToProtectedBranch adds toggle fields that allow
// the built-in actions bot user to bypass branch protection rules.
func AddActionsUserWhitelistToProtectedBranch(x *xorm.Engine) error {
	type ProtectedBranch struct {
		WhitelistActionsUser          bool `xorm:"NOT NULL DEFAULT false"`
		MergeWhitelistActionsUser     bool `xorm:"NOT NULL DEFAULT false"`
		ForcePushAllowlistActionsUser bool `xorm:"NOT NULL DEFAULT false"`
	}
	return x.Sync(new(ProtectedBranch))
}
