Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/src/analysis-paths.ts
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Chris Gavin
Convert all 4-space indented files to 2-space.
23 lines (18 sloc)
905 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as core from '@actions/core'; | |
import * as configUtils from './config-utils'; | |
export function includeAndExcludeAnalysisPaths(config: configUtils.Config, languages: string[]) { | |
if (config.paths.length !== 0) { | |
core.exportVariable('LGTM_INDEX_INCLUDE', config.paths.join('\n')); | |
} | |
if (config.pathsIgnore.length !== 0) { | |
core.exportVariable('LGTM_INDEX_EXCLUDE', config.pathsIgnore.join('\n')); | |
} | |
function isInterpretedLanguage(language): boolean { | |
return language === 'javascript' || language === 'python'; | |
} | |
// Index include/exclude only work in javascript and python | |
// If some other language is detected/configured show a warning | |
if ((config.paths.length !== 0 || config.pathsIgnore.length !== 0) && !languages.every(isInterpretedLanguage)) { | |
core.warning('The "paths"/"paths-ignore" fields of the config only have effect for Javascript and Python'); | |
} | |
} |