The update pages method (UpdatePages) doesn't work on github enterprise server, causing the error
"400 Custom domains are not available for GitHub Pages"
An example can be seen here: integrations/terraform-provider-github#2087
The update struct doesn't specify "omitempty" for its json marshalling. As a result, the client will send an explicit null value.
Unfortunately, github is inconsistent in how it treats this value on GHES vs GitHub proper (cloud) - specifying any value including null is not allowed in GHES.