Fix cached error when .domains is not readable (fixes https://codeberg.org/Codeberg/Community/issues/1512)

Co-authored-by: @algernon
Moritz Marquardt 2024-04-02 21:04:40 +02:00
rodzic 275c580706
commit 61f7a65855
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -33,7 +33,8 @@ func (o *Options) CheckCanonicalDomain(giteaClient *gitea.Client, actualDomain,
body, err := giteaClient.GiteaRawContent(o.TargetOwner, o.TargetRepo, o.TargetBranch, canonicalDomainConfig)
if err != nil && !errors.Is(err, gitea.ErrorNotFound) {
log.Error().Err(err).Msgf("could not read %s of %s/%s", canonicalDomainConfig, o.TargetOwner, o.TargetRepo)
// TODO: WTF we just continue?! Seems fine as body is empty... :/
// Assume that the domain is valid, as Gitea seems to be broken. Don't cache it though.
return actualDomain, true
}
var domains []string