Skip to content

Commit 9641105

Browse files
committed
explicit writing to env
1 parent 9029e08 commit 9641105

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ jobs:
6565
run: |
6666
echo "Installing CodeQL"
6767
qlt codeql run install --base example/
68-
echo "QLT_CODEQL_HOME=$QLT_CODEQL_HOME" >> $GITHUB_ENV
69-
echo "QLT_CODEQL_PATH=$QLT_CODEQL_PATH" >> $GITHUB_ENV
70-
7168
echo "-----------------------------"
7269
echo "CodeQL Home: $QLT_CODEQL_HOME"
7370
echo "CodeQL Binary: $QLT_CODEQL_PATH"

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: 7 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;
@@ -37,6 +38,12 @@ public override void Run()
3738
Environment.SetEnvironmentVariable("QLT_CODEQL_HOME", installation.CodeQLHome);
3839
Environment.SetEnvironmentVariable("QLT_CODEQL_PATH", installation.CodeQLToolBinary);
3940

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

4249

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)