Fix/ghes sarif baseurl - #300
Conversation
…kit when uploading SARIF" This reverts commit e62277a.
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
| const octokit = new core_1.Octokit({ auth: token }); | ||
| let response; | ||
| response = yield octokit.request('POST /repos/{owner}/{repo}/code-scanning/sarifs', { | ||
| var _a, _b, _c; |
There was a problem hiding this comment.
also variable declaration can be moved closer to usage
There was a problem hiding this comment.
Its lib code and generated by the compiler
| const octokit: Octokit = new Octokit({ auth: token }); | ||
| let response: OctokitResponse<any> | undefined; | ||
| response = await octokit.request('POST /repos/{owner}/{repo}/code-scanning/sarifs', { | ||
| const inputBaseUrl = core.getInput('ghe-base-url', { required: false }) || core.getInput('ghe_base_url', { required: false }) || ''; |
There was a problem hiding this comment.
why support both conventions ? "-" and "_" ?
There was a problem hiding this comment.
For the sake of compatibility, errors may occur.
Summary
This PR adds support for GitHub Enterprise Server when uploading code scanning SARIF:
ghe-base-url(and aliasghe_base_url).uploadCodeScanningSarifnow uses@actions/github.getOctokit(token, { baseUrl }).ghe[-_]base_urlis provided, it is used.@actions/githubon self-hosted runners.Why
Octokit requires an explicit
baseUrlto talk to GHES REST API; otherwise it targets api.github.com.Using
@actions/github.getOctokitaligns with other official actions and preserves GHES proxy settings.Notes
lib/accordingly.