@@ -14,31 +14,31 @@ impl SastTool {
14
14
pub async fn run_scan (
15
15
& self ,
16
16
_path : & str ,
17
- _commit_id : Option < & str > ,
18
- _branch : Option < & str > ,
17
+ base_branch : Option < & str > ,
18
+ pr_branch : Option < & str > ,
19
19
rule_path : String ,
20
20
verbose : bool ,
21
21
) {
22
22
let start_time = Instant :: now ( ) ;
23
23
if verbose {
24
24
println ! ( "[+] Running SAST scan on path: {}" , _path) ;
25
25
}
26
- println ! ( "Commit ID : {:?}" , _commit_id ) ;
27
- println ! ( "Branch: {:?}" , _branch ) ;
26
+ println ! ( "Base Branch : {:?}" , base_branch ) ;
27
+ println ! ( "PR Branch: {:?}" , pr_branch ) ;
28
28
if !std:: path:: Path :: new ( "/tmp/app" ) . exists ( ) {
29
29
if _path. starts_with ( "http" ) {
30
30
if verbose {
31
31
println ! ( "[+] Cloning git repo..." ) ;
32
32
}
33
- if let Some ( _branch ) = _branch {
34
- if _commit_id . is_some ( ) {
35
- let branch = Some ( _branch ) ;
36
- let out = checkout ( _path, "/tmp/app" , _commit_id , branch) ;
33
+ if let Some ( pr_branch ) = pr_branch {
34
+ if base_branch . is_some ( ) {
35
+ let branch = Some ( pr_branch ) ;
36
+ let out = checkout ( _path, "/tmp/app" , base_branch , branch) ;
37
37
if out. is_err ( ) {
38
38
println ! ( "Error while cloning: {}" , out. err( ) . unwrap( ) ) ;
39
39
}
40
40
} else {
41
- let branch = Some ( _branch ) ;
41
+ let branch = Some ( pr_branch ) ;
42
42
let out = checkout ( _path, "/tmp/app" , None , branch) ;
43
43
if out. is_err ( ) {
44
44
println ! ( "Error while cloning: {}" , out. err( ) . unwrap( ) ) ;
0 commit comments