The PR #1246 replaced the `getOctokit` method from the
`octokit-provider.ts` file with the `getOctokit` method from the
`@actions/github` package.
The octokit-provider was previously responsible for creating an Octokit
instance and setting the `baseUrl` via the `getServerApiUrl` helper
function. This function calls `getServerUrl` which reads the server url
from the `GITHUB_SERVER_URL` environment variable, which on GHES is set
to the enterprise instance.
This commit restores the previous behaviour by calling `getServerApiUrl`
in all places where an octokit instance is created.
Co-authored-by: Markus Wolf <mail@markus-wolf.de>
When trying to list local branches to figure out what needs cleaned up during runs on non-ephemeral Actions Runners, we use git rev-parse --symbolic-full-name to get a list of branches. This can lead to ambiguous ref name errors when there are branches and tags with similar names.
Part of the reason we use rev-parse --symbolic-full-name vs git branch --list or git rev-parse --symbolic seems to related to a bug in Git 2.18. Until we can deprecate our usage of Git 2.18, I think we need to keep --symbolic-full-name. Since part of the problem is that these ambiguous ref name errors clog the Actions annotation limits, this is a mitigation to suppress those messages until we can get rid of the workaround.
* Adding the ability to specify the GitHub Server URL and allowing for it to differ from the Actions workflow host
* Adding tests for injecting the GitHub URL
* Addressing code review comments for PR #922