mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Add DEFAULT_MIRROR_REPO_UNITS and DEFAULT_TEMPLATE_REPO_UNITS options (#32416)
				
					
				
			Resolve #30350 The action unit of mirrors and templates should be disabled by default. This PR adds `DEFAULT_MIRROR_REPO_UNITS` and `DEFAULT_TEMPLATE_REPO_UNITS` options to allow users to specify default units for mirrors and templates. Thanks to @lng2020 for the [idea](https://github.com/go-gitea/gitea/issues/30350#issuecomment-2053942243)
This commit is contained in:
		| @@ -381,8 +381,13 @@ func CreateRepositoryByExample(ctx context.Context, doer, u *user_model.User, re | ||||
|  | ||||
| 	// insert units for repo | ||||
| 	defaultUnits := unit.DefaultRepoUnits | ||||
| 	if isFork { | ||||
| 	switch { | ||||
| 	case isFork: | ||||
| 		defaultUnits = unit.DefaultForkRepoUnits | ||||
| 	case repo.IsMirror: | ||||
| 		defaultUnits = unit.DefaultMirrorRepoUnits | ||||
| 	case repo.IsTemplate: | ||||
| 		defaultUnits = unit.DefaultTemplateRepoUnits | ||||
| 	} | ||||
| 	units := make([]repo_model.RepoUnit, 0, len(defaultUnits)) | ||||
| 	for _, tp := range defaultUnits { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user