mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 12:10:20 +08:00
Add support for downloading packs from GHES
This change adds:
- new `registries` block allowed in code scanning config file
- new `registries-auth-tokens` input in init action
- Change the downloadPacks function so that it accepts new parameters:
- registries block
- api auth
- Generate a qlconfig.yml file with the registries block if one is
supplied. Use this file when downloading packs.
- temporarily set the `GITHUB_TOKEN` and `CODEQL_REGISTRIES_AUTH` based
on api auth
TODO:
1. integration test
2. handle pack downloads when the config is generated by the CLI
This commit is contained in:
4
lib/util.test.js
generated
4
lib/util.test.js
generated
@@ -156,6 +156,7 @@ function mockGetMetaVersionHeader(versionHeader) {
|
||||
auth: "",
|
||||
url: "https://github.com",
|
||||
apiURL: undefined,
|
||||
registriesAuthTokens: undefined,
|
||||
});
|
||||
t.deepEqual(util.GitHubVariant.DOTCOM, v.type);
|
||||
mockGetMetaVersionHeader("2.0");
|
||||
@@ -163,6 +164,7 @@ function mockGetMetaVersionHeader(versionHeader) {
|
||||
auth: "",
|
||||
url: "https://ghe.example.com",
|
||||
apiURL: undefined,
|
||||
registriesAuthTokens: undefined,
|
||||
});
|
||||
t.deepEqual({ type: util.GitHubVariant.GHES, version: "2.0" }, v2);
|
||||
mockGetMetaVersionHeader("GitHub AE");
|
||||
@@ -170,6 +172,7 @@ function mockGetMetaVersionHeader(versionHeader) {
|
||||
auth: "",
|
||||
url: "https://example.githubenterprise.com",
|
||||
apiURL: undefined,
|
||||
registriesAuthTokens: undefined,
|
||||
});
|
||||
t.deepEqual({ type: util.GitHubVariant.GHAE }, ghae);
|
||||
mockGetMetaVersionHeader(undefined);
|
||||
@@ -177,6 +180,7 @@ function mockGetMetaVersionHeader(versionHeader) {
|
||||
auth: "",
|
||||
url: "https://ghe.example.com",
|
||||
apiURL: undefined,
|
||||
registriesAuthTokens: undefined,
|
||||
});
|
||||
t.deepEqual({ type: util.GitHubVariant.DOTCOM }, v3);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user