GitHub Codespaces includes Hugo by default, but it's not an extended release.
To install the latest extended release in your codespace container, execute this gist in postCreateCommand of .devcontainer/devcontainer.json:
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"postCreateCommand": "curl -fsSL https://gist.githubusercontent.com/cariad/dfecce84ee9d556bccfc8a35ed47c0a2/raw/dff860658305586c6f3b9d624979b0503575e8a9/install-hugo-extended.sh | bash"
}