You actually do not want to clone the code from Github and use it verbatim because if you build that, you will get a debug build.
In particular, it will include commits from a few hours ago that are not tested fully and can compromise the stability of Core and could even have regressions.
Checking out the tree to a known working version e.g. 23.0 is identical to downloading the corresponding source code from bitcoincore.org (and the Github Releases page), and is absolutely necessary to do if you want a stable Core.
That's why it is better to rely on TAGs provided by authors. Usually tag x = release x, that way you are (almost) sure that final product will be the same as released binary.
For example for the latest version you look for that state:
https://github.com/bitcoin/bitcoin/tree/v23.0The same zipped sources which you see under /releases/ have the same content you find using tags.