Document the CodeQL version that is installed.

This commit is contained in:
Chris Gavin
2020-09-17 18:41:07 +01:00
parent c72e08b8b6
commit 60d40e5dd5
3 changed files with 14 additions and 0 deletions

View File

@@ -5,6 +5,7 @@
################################################################################ ################################################################################
source $HELPER_SCRIPTS/install.sh source $HELPER_SCRIPTS/install.sh
source $HELPER_SCRIPTS/document.sh
# Retrieve the name of the CodeQL bundle preferred by the Action (in the format codeql-bundle-YYYYMMDD). # Retrieve the name of the CodeQL bundle preferred by the Action (in the format codeql-bundle-YYYYMMDD).
codeql_bundle_name="$(curl -sSL https://raw.githubusercontent.com/github/codeql-action/main/src/defaults.json | jq -r .bundleVersion)" codeql_bundle_name="$(curl -sSL https://raw.githubusercontent.com/github/codeql-action/main/src/defaults.json | jq -r .bundleVersion)"
@@ -23,3 +24,7 @@ touch "$extraction_directory/pinned-version"
# Test that the tool has been extracted successfully. # Test that the tool has been extracted successfully.
"$AGENT_TOOLSDIRECTORY/CodeQL/$codeql_bundle_version/x64/codeql/codeql" version "$AGENT_TOOLSDIRECTORY/CodeQL/$codeql_bundle_version/x64/codeql/codeql" version
# Document the version installed.
version="$("$AGENT_TOOLSDIRECTORY/CodeQL/$codeql_bundle_version/x64/codeql/codeql" version --quiet)"
DocumentInstalledItem "CodeQL Action Bundle ($version)"

View File

@@ -77,6 +77,7 @@ $markdown += New-MDList -Style Unordered -Lines @(
(Get-BazelVersion), (Get-BazelVersion),
(Get-BazeliskVersion), (Get-BazeliskVersion),
(Get-CMakeVersion), (Get-CMakeVersion),
(Get-CodeQLBundleVersion),
(Get-RVersion), (Get-RVersion),
(Get-DockerVersion), (Get-DockerVersion),
(Get-DockerComposeVersion), (Get-DockerComposeVersion),

View File

@@ -30,6 +30,14 @@ function Get-CMakeVersion {
return "CMake $cmakeVersion" return "CMake $cmakeVersion"
} }
function Get-CodeQLBundleVersion {
$CodeQLVersionsWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "codeql" | Join-Path -ChildPath "*"
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Select-Object -First 1 -Expand FullName
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql.exe"
$CodeQLVersion = $($CodeQLPath version --quiet)
return "CodeQL Action Bundle $CodeQLVersion"
}
function Get-DockerVersion { function Get-DockerVersion {
$dockerVersion = $(docker version --format "{{.Server.Version}}") $dockerVersion = $(docker version --format "{{.Server.Version}}")
return "Docker $dockerVersion" return "Docker $dockerVersion"