diff --git a/images/linux/scripts/installers/codeql-bundle.sh b/images/linux/scripts/installers/codeql-bundle.sh index 600089630..825ce0708 100644 --- a/images/linux/scripts/installers/codeql-bundle.sh +++ b/images/linux/scripts/installers/codeql-bundle.sh @@ -18,5 +18,8 @@ echo "Downloading CodeQL bundle $codeql_bundle_version..." download_with_retries "https://github.com/github/codeql-action/releases/download/$codeql_bundle_name/codeql-bundle.tar.gz" "/tmp" "codeql-bundle.tar.gz" tar -xzf "/tmp/codeql-bundle.tar.gz" -C "$extraction_directory" +# Touch a special file that indicates to the CodeQL Action that this bundle was baked-in to the hosted runner images. +touch "$extraction_directory/pinned-version" + # Test that the tool has been extracted successfully. "$AGENT_TOOLSDIRECTORY/CodeQL/$codeql_bundle_version/x64/codeql/codeql" version diff --git a/images/win/scripts/Installers/Install-CodeQLBundle.ps1 b/images/win/scripts/Installers/Install-CodeQLBundle.ps1 index 46a597592..d8f21f0df 100644 --- a/images/win/scripts/Installers/Install-CodeQLBundle.ps1 +++ b/images/win/scripts/Installers/Install-CodeQLBundle.ps1 @@ -18,5 +18,8 @@ Extract-7Zip -Path $CodeQLBundlePath -DestinationPath $DownloadDirectoryPath $UnGzipedCodeQLBundlePath = Join-Path $DownloadDirectoryPath "codeql-bundle.tar" Extract-7Zip -Path $UnGzipedCodeQLBundlePath -DestinationPath $ExtractionDirectory +# Touch a special file that indicates to the CodeQL Action that this bundle was baked-in to the hosted runner images. +New-Item -ItemType file (Join-Path $ExtractionDirectory -ChildPath "pinned-version") + # Test that the tool has been extracted successfully. Invoke-PesterTests -TestFile "Tools" -TestName "CodeQLBundle"