Skip to content

Commit 7615bca

Browse files
authored
Merge pull request #17 from advanced-security/jsinglet/bundle-feature-tmp
Integration PR to test Workflows
2 parents b057a95 + 595350a commit 7615bca

File tree

5 files changed

+25
-2
lines changed

5 files changed

+25
-2
lines changed

.github/workflows/run-codeql-unit-tests-cpp.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ on:
55
push:
66
branches:
77
- 'main'
8+
- 'jsinglet/**'
89
pull_request:
910
branches:
1011
- 'main'
12+
- 'jsinglet/**'
1113
workflow_dispatch:
1214

1315

@@ -63,6 +65,9 @@ jobs:
6365
run: |
6466
echo "Installing CodeQL"
6567
qlt codeql run install --base example/
68+
echo "-----------------------------"
69+
echo "CodeQL Home: $QLT_CODEQL_HOME"
70+
echo "CodeQL Binary: $QLT_CODEQL_PATH"
6671
6772
- name: Verify Versions of Tooling
6873
shell: bash

src/CodeQLToolkit.Features/CodeQL/Commands/CodeQLCommandFeature.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public void Register(Command parentCommand)
5454
new InstallCommand()
5555
{
5656
Base = basePath,
57+
AutomationTarget = automationType,
5758
}.Run();
5859

5960

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using CodeQLToolkit.Shared.CodeQL;
2+
using CodeQLToolkit.Shared.Types;
23
using Newtonsoft.Json;
34
using System;
45
using System.Collections.Generic;
@@ -29,10 +30,20 @@ public override void Run()
2930
Log<InstallCommand>.G().LogInformation($"Installing CodeQL...");
3031
installation.Install();
3132

33+
3234
// set the environment variable
35+
Log<InstallCommand>.G().LogInformation($"Setting QLT_CODEQL_HOME to {installation.CodeQLHome}...");
36+
Log<InstallCommand>.G().LogInformation($"Setting QLT_CODEQL_PATH to {installation.CodeQLToolBinary}...");
37+
3338
Environment.SetEnvironmentVariable("QLT_CODEQL_HOME", installation.CodeQLHome);
3439
Environment.SetEnvironmentVariable("QLT_CODEQL_PATH", installation.CodeQLToolBinary);
3540

41+
if (AutomationTypeHelper.AutomationTypeFromString(AutomationTarget) == AutomationType.ACTIONS)
42+
{
43+
File.AppendAllText(Environment.GetEnvironmentVariable("GITHUB_ENV"), $"QLT_CODEQL_HOME={installation.CodeQLHome}" + "\n");
44+
File.AppendAllText(Environment.GetEnvironmentVariable("GITHUB_ENV"), $"QLT_CODEQL_PATH={installation.CodeQLToolBinary}" + "\n");
45+
}
46+
3647
}
3748

3849

src/CodeQLToolkit.Features/Query/Commands/Targets/InstallQueryPacksCommandTarget.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using CodeQLToolkit.Shared.CodeQL;
2+
using System;
23
using System.Collections.Generic;
34
using System.Diagnostics;
45
using System.Linq;
@@ -18,13 +19,17 @@ public override void Run()
1819

1920
Log<InstallQueryPacksCommandTarget>.G().LogInformation($"Got {files.Length} packs...");
2021

22+
23+
var installation = CodeQLInstallation.LoadFromConfig(Base);
24+
25+
2126
foreach ( string file in files )
2227
{
2328
Log<InstallQueryPacksCommandTarget>.G().LogInformation($"Installing qlpack {file}...");
2429

2530
using(Process process = new Process())
2631
{
27-
process.StartInfo.FileName = "codeql";
32+
process.StartInfo.FileName = installation.CodeQLToolBinary;
2833
process.StartInfo.UseShellExecute = false;
2934
process.StartInfo.RedirectStandardOutput = false;
3035
process.StartInfo.Arguments = $"pack install {file}";

src/CodeQLToolkit.Shared/Target/CommandTarget.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ namespace CodeQLToolkit.Shared.Target
99
public abstract class CommandTarget : ITarget
1010
{
1111
public string Language { get; set; }
12+
public string AutomationTarget { get; set; }
1213
}
1314
}

0 commit comments

Comments
 (0)