mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 06:21:11 +00:00 
			
		
		
		
	[FEAT] Configure if protected branch rule should apply to admins
- Currently protected branch rules do not apply to admins, however in some cases (like in the case of Forgejo project) you might also want to apply these rules to admins to avoid accidental merges. - Add new option to configure this on a per-rule basis. - Adds integration tests. - Resolves #65
This commit is contained in:
		
					parent
					
						
							
								a11116602e
							
						
					
				
			
			
				commit
				
					
						79b7089360
					
				
			
		
					 16 changed files with 167 additions and 26 deletions
				
			
		|  | @ -47,6 +47,7 @@ type BranchProtection struct { | |||
| 	RequireSignedCommits          bool     `json:"require_signed_commits"` | ||||
| 	ProtectedFilePatterns         string   `json:"protected_file_patterns"` | ||||
| 	UnprotectedFilePatterns       string   `json:"unprotected_file_patterns"` | ||||
| 	ApplyToAdmins                 bool     `json:"apply_to_admins"` | ||||
| 	// swagger:strfmt date-time | ||||
| 	Created time.Time `json:"created_at"` | ||||
| 	// swagger:strfmt date-time | ||||
|  | @ -80,6 +81,7 @@ type CreateBranchProtectionOption struct { | |||
| 	RequireSignedCommits          bool     `json:"require_signed_commits"` | ||||
| 	ProtectedFilePatterns         string   `json:"protected_file_patterns"` | ||||
| 	UnprotectedFilePatterns       string   `json:"unprotected_file_patterns"` | ||||
| 	ApplyToAdmins                 bool     `json:"apply_to_admins"` | ||||
| } | ||||
| 
 | ||||
| // EditBranchProtectionOption options for editing a branch protection | ||||
|  | @ -106,4 +108,5 @@ type EditBranchProtectionOption struct { | |||
| 	RequireSignedCommits          *bool    `json:"require_signed_commits"` | ||||
| 	ProtectedFilePatterns         *string  `json:"protected_file_patterns"` | ||||
| 	UnprotectedFilePatterns       *string  `json:"unprotected_file_patterns"` | ||||
| 	ApplyToAdmins                 *bool    `json:"apply_to_admins"` | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue