#help (2023-01)
Where to get help about getting help!
2023-01-16

hi @Erik Osterman (Cloud Posse) I am using GitHub Enterprise and trying to figure out what exactly is GITHUB_UPLOAD_URL / uploadURL ? can anyone help me around this? This seems to be a mandatory flag while using baseURL Anyone who can help me with this ?

Please provide context :-) is this a GitHub Action or terraform module?

sorry for that. @Erik Osterman (Cloud Posse) its about https://github.com/cloudposse/github-commenter since I’m using GitHub Enterprise for GitHub Commenter and will be passing BaseURL , its mandatory to pass Upload URL. The description in the documentation around Upload URL doesnt give me a clear picture what exactly it requires. Some example will be helpful.

base URL and upload URL are for GitHub enterprise

// NewEnterpriseClient returns a new GitHub API client with provided
// base URL and upload URL (often is your GitHub Enterprise hostname).
// If the base URL does not have the suffix "/api/v3/", it will be added automatically.
// If the upload URL does not have the suffix "/api/uploads", it will be added automatically.
// If a nil httpClient is provided, a new http.Client will be used.
//
// Note that NewEnterpriseClient is a convenience helper only;
// its behavior is equivalent to using NewClient, followed by setting
// the BaseURL and UploadURL fields.
//
// Another important thing is that by default, the GitHub Enterprise URL format
// should be http(s)://[hostname]/api/v3/ or you will always receive the 406 status code.
// The upload URL format should be http(s)://[hostname]/api/uploads/.
func NewEnterpriseClient(baseURL, uploadURL string, httpClient *http.Client) (*Client, error) {

GitHub Enterprise Cloud expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body


for GH Enterprise, the base URL is different
The baseURL of the public facing API is simply: <https://api.github.com/>"
However for enterprise Github instances the baseURL for the API is slightly different: https://github.com/api/v3/"
Using a baseURL without the /api/v3/ suffix will result in HTTP 406 Not Acceptable errors and lead you down a path of debugging Oauth clients and request headers. I learnt this after many hours and tears.

and it requires a separate upload URL to upload assets in binary format

so base URL is your GitHub Enterprise hostname + /api/v3/

the upload URL is your GitHub Enterprise hostname + /api/uploads/

Thanks @Andriy Knysh (Cloud Posse)! this is helpful.