actions / github-script

Write workflows scripting the GitHub API in JavaScript
MIT License
4.24k stars 424 forks source link

Add base-url option #429

Closed robandpdx closed 1 year ago

robandpdx commented 1 year ago

Resolves #428

gustavkj commented 1 year ago

Ironically, this broke workflows on Github Enterprise. I think the undefined value still will be interpreted as the value being set.

It worked before without any extra config, since Github Enterprise set the GITHUB_API_URL environment variable (just like Github.com, see docs) and it used by the @actions/github package to set the base url here: https://github.com/actions/toolkit/blob/20f826bfe76164099ab2403d9ea8509e16843223/packages/github/src/internal/utils.ts#L42-L44

One solution would be to set a default value to be the pre-configured value, or fix the assignment to the opts object only when it is set.

I've opened a bug: https://github.com/actions/github-script/issues/436