Restore compatibility with GHES 3.1 by cklin · Pull Request #978 · github/codeql-action (original) (raw)

@cklin

This PR fixes a few problems related to GHES compatibility.

Merge / deployment checklist

@cklin

adityasharad

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestions. Also did you mean to open this from your main branch?

## [UNRELEASED]
No user facing changes.
- Fix a bug where actions would fail when used with GHES 3.3 or earlier. [#978](https://github.com/github/codeql-action/pull/978)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are two bugs fixed here: one on 3.3 and earlier due to RUNNER_ARCH, and one on 3.1 and earlier due to unexpected telemetry fields. Could you expand this a little bit so that users know which errors will go away by updating?

statusReport.matrix_vars = matrix;
}
if ("RUNNER_ARCH" in process.env) {
// RUNNER_ARCH is available only in GHES 3.4 and later

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: worth commenting that the server will filter out unknown/unfamiliar values.

*
* @returns GitHub version
*/
export async function getGitHubVersion(): Promise {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: How about something like getGitHubVersionActionsOnly?

* Report the GitHub server version. This is a wrapper around
* util.getGitHubVersion() that automatically supplies GitHub API details using
* GitHub Action inputs. If you need to get the GitHub server version from the
* action runner, please call util.getGitHubVersion() instead.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* action runner, please call util.getGitHubVersion() instead.
* Runner, please call util.getGitHubVersion() instead.

@cklin

Also did you mean to open this from your main branch?

Good catch! And no, it was a screw-up on my part.

I don't think there is a way to switch the source branch of a PR, so I will just have to learn my lesson and put the main branch of my fork back in order afterwards.

@cklin

@cklin

@cklin

@adityasharad
Thank you for your feedback; I think I addressed them all. Please take another look. Thank you!

adityasharad

@cklin cklin deleted the restore-ghes-compatibility branch

March 15, 2022 16:29

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})