1
1
mirror of https://github.com/go-gitea/gitea synced 2025-01-10 09:44:43 +00:00
Jason Song 7985cde84d
Fix Actions being enabled accidentally (#24802)
Regression of #24536. If the user doesn't explicitly disable Actions, it
will be enabled.

1. Gitea will call `loadRepositoryFrom` before `loadActionsFrom`.

25d4f95df2/modules/setting/setting.go (L234-L237)
2. In `loadRepositoryFrom`,
`rootCfg.Section("actions").Key("ENABLED").MustBool(true)` will set
`actions.ENABLED` with `true`.

25d4f95df2/modules/setting/repository.go (L313-L315)
3. In `loadActionsFrom`, `rootCfg.Section("actions")` will get a section
with Actions enabled.

25d4f95df2/modules/setting/actions.go (L23-L26)

Although the cause of the problem was using `true` by copy-paste
mistake, it also surprised me that
**`rootCfg.Section("actions").Key("ENABLED").MustBool(true)` doesn't
only read, but also write.**
2023-05-19 19:35:12 +08:00
..
2023-05-08 19:49:59 +08:00
2023-03-13 15:51:07 +08:00
2023-05-08 19:49:59 +08:00
2023-04-25 23:06:39 +08:00
2023-02-20 16:18:26 -06:00
2023-04-25 23:06:39 +08:00
2023-05-14 23:38:40 +08:00
2023-05-08 19:49:59 +08:00
2023-04-25 23:06:39 +08:00
2023-02-20 16:18:26 -06:00
2023-04-13 15:45:33 -04:00
2023-05-08 19:49:59 +08:00
2023-04-25 23:06:39 +08:00
2023-02-20 16:18:26 -06:00