Skip to content

Commit 48cfab6

Browse files
committed
add bundle to flow
1 parent 1d626b8 commit 48cfab6

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

.github/workflows/internal-pr-bundle-integration-test-cpp.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
languages: ${{ matrix.language }}
6868
queries: security-extended
6969
source-root: integration-tests/cpp/src/ # Path containing the example application
70-
tools: ${{ env.QLT_CODEQL_HOME }}/../out/codeql-bundle.tar.gz
70+
tools: ${{ env.QLT_CODEQL_BUNDLE_PATH }}
7171

7272
- name: Autobuild
7373
uses: github/codeql-action/autobuild@v2
@@ -93,14 +93,13 @@ jobs:
9393
${{ steps.analysis.outputs.sarif-output }}/*.sarif
9494
if-no-files-found: error
9595

96-
# - name: Upload Bundle Used
97-
# uses: actions/upload-artifact@v2
98-
# with:
99-
# name: codeql-bundle.tar.gz
100-
# path: |
101-
# ${{ env.QLT_CODEQL_HOME }}/../out/codeql-bundle.tar.gz
102-
# if-no-files-found: error
103-
96+
- name: Upload Bundle Used
97+
uses: actions/upload-artifact@v2
98+
with:
99+
name: codeql-bundle.tar.gz
100+
path: |
101+
${{ env.QLT_CODEQL_BUNDLE_PATH }}
102+
if-no-files-found: error
104103

105104
- name: Validate SARIF Results
106105
shell: bash

src/CodeQLToolkit.Features/CodeQL/Commands/Targets/InstallCommand.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,22 @@ public override void Run()
5858

5959
Environment.SetEnvironmentVariable("QLT_CODEQL_HOME", installation.CodeQLHome);
6060
Environment.SetEnvironmentVariable("QLT_CODEQL_PATH", installation.CodeQLToolBinary);
61+
if (CustomBundles || QuickBundles)
62+
{
63+
Environment.SetEnvironmentVariable("QLT_CODEQL_BUNDLE_PATH", installation.CustomBundleOutputBundle);
64+
}
6165

6266
if (AutomationTypeHelper.AutomationTypeFromString(AutomationTarget) == AutomationType.ACTIONS)
6367
{
6468
if (Environment.GetEnvironmentVariable("GITHUB_ENV") != null && File.Exists(Environment.GetEnvironmentVariable("GITHUB_ENV")))
6569
{
70+
6671
File.AppendAllText(Environment.GetEnvironmentVariable("GITHUB_ENV"), $"QLT_CODEQL_HOME={installation.CodeQLHome}" + "\n");
6772
File.AppendAllText(Environment.GetEnvironmentVariable("GITHUB_ENV"), $"QLT_CODEQL_PATH={installation.CodeQLToolBinary}" + "\n");
73+
if (CustomBundles || QuickBundles)
74+
{
75+
File.AppendAllText(Environment.GetEnvironmentVariable("GITHUB_ENV"), $"QLT_CODEQL_BUNDLE_PATH={installation.CustomBundleOutputBundle}" + "\n");
76+
}
6877
}
6978
}
7079

src/CodeQLToolkit.Shared/CodeQL/RESOLUTION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ For a bundle installation the mapping is as follows:
4747

4848
- `CodeQLCLIBundle` - The bundle downloaded from `github/codeql-action/releases` to base the bundle on.
4949

50-
In all cases, at the end of the execution two environment variables are set:
50+
In all cases, at the end of the execution two to three environment variables are set:
5151
- `QLT_CODEQL_PATH` - The path to the CodeQL binary.
5252
- `QLT_CODEQL_HOME` - The root installation of CodeQL
53+
- `QLT_CODEQL_BUNDLE_PATH` - The path to the bundle created by QLT.
5354

5455
## Idents within the Installation Directory
5556

0 commit comments

Comments
 (0)