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

Co-authored-by: @algernon
This commit is contained in:
Moritz Marquardt 2024-04-02 21:04:40 +02:00
parent f6d3147ba1
commit 584ba5c74d

View file

@ -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