Hi!
Codeberg uses Forgejo which is forked from Gitea, and Gitea seems to support OAuth2 and Open ID Connect, for which Discourse has extensive support through plugins:
You can find Codeberg’s OIDC discovery document here, which should get you started: