File tree Expand file tree Collapse file tree 5 files changed +25
-2
lines changed
CodeQLToolkit.Shared/Target Expand file tree Collapse file tree 5 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 5
5
push :
6
6
branches :
7
7
- ' main'
8
+ - ' jsinglet/**'
8
9
pull_request :
9
10
branches :
10
11
- ' main'
12
+ - ' jsinglet/**'
11
13
workflow_dispatch :
12
14
13
15
63
65
run : |
64
66
echo "Installing CodeQL"
65
67
qlt codeql run install --base example/
68
+ echo "-----------------------------"
69
+ echo "CodeQL Home: $QLT_CODEQL_HOME"
70
+ echo "CodeQL Binary: $QLT_CODEQL_PATH"
66
71
67
72
- name : Verify Versions of Tooling
68
73
shell : bash
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ public void Register(Command parentCommand)
54
54
new InstallCommand ( )
55
55
{
56
56
Base = basePath ,
57
+ AutomationTarget = automationType ,
57
58
} . Run ( ) ;
58
59
59
60
Original file line number Diff line number Diff line change 1
1
using CodeQLToolkit . Shared . CodeQL ;
2
+ using CodeQLToolkit . Shared . Types ;
2
3
using Newtonsoft . Json ;
3
4
using System ;
4
5
using System . Collections . Generic ;
@@ -29,10 +30,20 @@ public override void Run()
29
30
Log < InstallCommand > . G ( ) . LogInformation ( $ "Installing CodeQL...") ;
30
31
installation . Install ( ) ;
31
32
33
+
32
34
// 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
+
33
38
Environment . SetEnvironmentVariable ( "QLT_CODEQL_HOME" , installation . CodeQLHome ) ;
34
39
Environment . SetEnvironmentVariable ( "QLT_CODEQL_PATH" , installation . CodeQLToolBinary ) ;
35
40
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
+
36
47
}
37
48
38
49
Original file line number Diff line number Diff line change 1
- using System ;
1
+ using CodeQLToolkit . Shared . CodeQL ;
2
+ using System ;
2
3
using System . Collections . Generic ;
3
4
using System . Diagnostics ;
4
5
using System . Linq ;
@@ -18,13 +19,17 @@ public override void Run()
18
19
19
20
Log < InstallQueryPacksCommandTarget > . G ( ) . LogInformation ( $ "Got { files . Length } packs...") ;
20
21
22
+
23
+ var installation = CodeQLInstallation . LoadFromConfig ( Base ) ;
24
+
25
+
21
26
foreach ( string file in files )
22
27
{
23
28
Log < InstallQueryPacksCommandTarget > . G ( ) . LogInformation ( $ "Installing qlpack { file } ...") ;
24
29
25
30
using ( Process process = new Process ( ) )
26
31
{
27
- process . StartInfo . FileName = "codeql" ;
32
+ process . StartInfo . FileName = installation . CodeQLToolBinary ;
28
33
process . StartInfo . UseShellExecute = false ;
29
34
process . StartInfo . RedirectStandardOutput = false ;
30
35
process . StartInfo . Arguments = $ "pack install { file } ";
Original file line number Diff line number Diff line change @@ -9,5 +9,6 @@ namespace CodeQLToolkit.Shared.Target
9
9
public abstract class CommandTarget : ITarget
10
10
{
11
11
public string Language { get ; set ; }
12
+ public string AutomationTarget { get ; set ; }
12
13
}
13
14
}
You can’t perform that action at this time.
0 commit comments