Skip to content

Commit 3ebbd71

Browse files
authored
Merge pull request #1514 from github/update-v2.2.1-4664f3969
Merge main into releases/v2
2 parents 436dbd9 + 2ae6e13 commit 3ebbd71

10 files changed

+26
-20
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CodeQL Action Changelog
22

3+
## 2.2.1 - 27 Jan 2023
4+
5+
No user facing changes.
6+
37
## 2.2.0 - 26 Jan 2023
48

59
- Improve stability when choosing the default version of CodeQL to use in code scanning workflow runs on Actions on GitHub.com. [#1475](https://github.com/github/codeql-action/pull/1475)

lib/codeql.test.js

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/codeql.test.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/setup-codeql.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeql",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"private": true,
55
"description": "CodeQL action",
66
"scripts": {

src/codeql.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ test("downloads and caches explicitly requested bundles that aren't in the toolc
208208
t.assert(toolcache.find("CodeQL", `0.0.0-${version}`));
209209
t.is(result.toolsVersion, `0.0.0-${version}`);
210210
t.is(result.toolsSource, ToolsSource.Download);
211-
t.is(typeof result.toolsDownloadDurationMs, "number");
211+
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
212212
}
213213

214214
t.is(toolcache.findAllVersions("CodeQL").length, 2);
@@ -241,7 +241,7 @@ test("downloads an explicitly requested bundle even if a different version is ca
241241
t.assert(toolcache.find("CodeQL", "0.0.0-20200610"));
242242
t.deepEqual(result.toolsVersion, "0.0.0-20200610");
243243
t.is(result.toolsSource, ToolsSource.Download);
244-
t.not(result.toolsDownloadDurationMs, undefined);
244+
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
245245
});
246246
});
247247

@@ -293,7 +293,7 @@ for (const {
293293
t.assert(toolcache.find("CodeQL", expectedToolcacheVersion));
294294
t.deepEqual(result.toolsVersion, cliVersion);
295295
t.is(result.toolsSource, ToolsSource.Download);
296-
t.not(result.toolsDownloadDurationMs, undefined);
296+
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
297297
});
298298
});
299299
}
@@ -428,7 +428,7 @@ for (const variant of [util.GitHubVariant.GHAE, util.GitHubVariant.GHES]) {
428428
);
429429
t.deepEqual(result.toolsVersion, defaults.cliVersion);
430430
t.is(result.toolsSource, ToolsSource.Download);
431-
t.is(typeof result.toolsDownloadDurationMs, "number");
431+
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
432432

433433
const cachedVersions = toolcache.findAllVersions("CodeQL");
434434
t.is(cachedVersions.length, 2);
@@ -461,7 +461,7 @@ test('downloads bundle if "latest" tools specified but not cached', async (t) =>
461461
);
462462
t.deepEqual(result.toolsVersion, defaults.cliVersion);
463463
t.is(result.toolsSource, ToolsSource.Download);
464-
t.is(typeof result.toolsDownloadDurationMs, "number");
464+
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
465465

466466
const cachedVersions = toolcache.findAllVersions("CodeQL");
467467
t.is(cachedVersions.length, 2);
@@ -527,7 +527,7 @@ test("download codeql bundle from github ae endpoint", async (t) => {
527527
);
528528

529529
t.is(result.toolsSource, ToolsSource.Download);
530-
t.is(typeof result.toolsDownloadDurationMs, "number");
530+
t.assert(Number.isInteger(result.toolsDownloadDurationMs));
531531

532532
const cachedVersions = toolcache.findAllVersions("CodeQL");
533533
t.is(cachedVersions.length, 1);

src/setup-codeql.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,9 @@ export async function downloadCodeQL(
568568
undefined,
569569
finalHeaders
570570
);
571-
const toolsDownloadDurationMs = performance.now() - toolsDownloadStart;
571+
const toolsDownloadDurationMs = Math.round(
572+
performance.now() - toolsDownloadStart
573+
);
572574

573575
logger.debug(`CodeQL bundle download to ${codeqlPath} complete.`);
574576

0 commit comments

Comments
 (0)