feat: refactor HTTP client setup for Github and Forgejo services
- Centralized HTTP client configuration for `GithubService` and `ForgejoService` using `AddHttpClient`. - Enhanced maintainability by moving Forgejo token and base URL setup into DI-configured HTTP clients. - Fixed `forgejoInstance` validation logic and adjusted release selection to prioritize the first non-prerelease.
This commit is contained in:
1 parent
7ac8a5af62
commit
3b644de2d5
5 files changed
+20
-15
No files matched your search
@@ -24,7 +24,7 @@ public static class AppConfigLoader
|
||||
|
||||
if (string.IsNullOrEmpty(forgejoInstance))
|
||||
throw new Exception("FORGEJO_INSTANCE environment variable is required");
|
||||
if (!string.IsNullOrEmpty(forgejoToken) && forgejoInstance.EndsWith('/'))
|
||||
if (!string.IsNullOrEmpty(forgejoInstance) && forgejoInstance.EndsWith('/'))
|
||||
forgejoInstance = forgejoInstance[..^1];
|
||||
|
||||
if (string.IsNullOrEmpty(forgejoToken))
|
||||
|
||||
Reference in new issue
Block a user