From 0e7d9025f498fd2029dd8c75d7e14fcf879be8eb Mon Sep 17 00:00:00 2001 From: Jason Song Date: Fri, 19 May 2023 15:22:49 +0800 Subject: [PATCH 1/2] fix: disable actions by default --- modules/setting/repository.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/setting/repository.go b/modules/setting/repository.go index 153307a0b63da..c70c389db6cc6 100644 --- a/modules/setting/repository.go +++ b/modules/setting/repository.go @@ -310,7 +310,7 @@ func loadRepositoryFrom(rootCfg ConfigProvider) { Repository.DisabledRepoUnits = append(Repository.DisabledRepoUnits, "repo.packages") } - if !rootCfg.Section("actions").Key("ENABLED").MustBool(true) { + if !rootCfg.Section("actions").Key("ENABLED").MustBool(false) { Repository.DisabledRepoUnits = append(Repository.DisabledRepoUnits, "repo.actions") } From 845f86eb79d5d4aa30fdfad49ae4c797c75c8261 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Fri, 19 May 2023 17:41:43 +0800 Subject: [PATCH 2/2] fix: use default value --- modules/setting/repository.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/setting/repository.go b/modules/setting/repository.go index c70c389db6cc6..900b56cc52b33 100644 --- a/modules/setting/repository.go +++ b/modules/setting/repository.go @@ -306,11 +306,11 @@ func loadRepositoryFrom(rootCfg ConfigProvider) { log.Fatal("Failed to map Repository.PullRequest settings: %v", err) } - if !rootCfg.Section("packages").Key("ENABLED").MustBool(true) { + if !rootCfg.Section("packages").Key("ENABLED").MustBool(Packages.Enabled) { Repository.DisabledRepoUnits = append(Repository.DisabledRepoUnits, "repo.packages") } - if !rootCfg.Section("actions").Key("ENABLED").MustBool(false) { + if !rootCfg.Section("actions").Key("ENABLED").MustBool(Actions.Enabled) { Repository.DisabledRepoUnits = append(Repository.DisabledRepoUnits, "repo.actions") }