File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -136,13 +136,24 @@ impl Action {
136136 . collect ( )
137137 }
138138
139+ /// Gets the CodeQL directory to use for the action. It will first check if a local
140+ /// `.codeql` directory exists in the working directory parent. If not, it will
141+ /// use the `RUNNER_TEMP` directory. If neither exists, it will create a new
142+ /// `.codeql` directory in the working directory parent.
143+ ///
144+ /// It uses the parent of the working directory to to stop issues where the
145+ /// database/sarif files gets indexed by CodeQL.
139146 pub fn get_codeql_dir ( & self ) -> Result < PathBuf > {
140147 let paths = vec ! [
141- // Local CodeQL directory in the working directory
142- self . working_directory( ) ?. join( ".codeql" ) ,
148+ // Local CodeQL directory in the working directory parent
149+ self . working_directory( ) ?
150+ . join( ".." )
151+ . join( ".codeql" )
152+ . canonicalize( ) ?,
143153 // Runner temp directory
144154 PathBuf :: from( std:: env:: var( "RUNNER_TEMP" ) . unwrap_or_else( |_| "/tmp" . to_string( ) ) )
145- . join( ".codeql" ) ,
155+ . join( ".codeql" )
156+ . canonicalize( ) ?,
146157 ] ;
147158
148159 for path in paths {
You can’t perform that action at this time.
0 commit comments