-
Notifications
You must be signed in to change notification settings - Fork 104
Fix/ghes sarif baseurl #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjust variable naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also variable declaration can be moved closer to usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its lib code and generated by the compiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right sry
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why support both conventions ? "-" and "_" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.