Use a more explicit name for checking Go extraction output
This commit is contained in:
parent
215c3cb4bb
commit
8dc468564f
3 changed files with 13 additions and 7 deletions
9
lib/analyze-action.js
generated
9
lib/analyze-action.js
generated
|
|
@ -71,8 +71,11 @@ function hasBadExpectErrorInput() {
|
||||||
return (actionsUtil.getOptionalInput("expect-error") !== "false" &&
|
return (actionsUtil.getOptionalInput("expect-error") !== "false" &&
|
||||||
!util.isInTestMode());
|
!util.isInTestMode());
|
||||||
}
|
}
|
||||||
// Check for any .trap[.gz] files under the db-go/ folder
|
/**
|
||||||
function didGolangExtraction(config) {
|
* Returns whether any `.trap[.gz]` files exist under the `db-go` folder,
|
||||||
|
* indicating whether Go extraction has extracted at least one file.
|
||||||
|
*/
|
||||||
|
function doesGoExtractionOutputExist(config) {
|
||||||
const golangDbDirectory = util.getCodeQLDatabasePath(config, languages_1.Language.go);
|
const golangDbDirectory = util.getCodeQLDatabasePath(config, languages_1.Language.go);
|
||||||
const extractedFiles = fs
|
const extractedFiles = fs
|
||||||
.readdirSync(golangDbDirectory)
|
.readdirSync(golangDbDirectory)
|
||||||
|
|
@ -120,7 +123,7 @@ async function run() {
|
||||||
// Run autobuilder for Go, unless it's already been run or user built manually
|
// Run autobuilder for Go, unless it's already been run or user built manually
|
||||||
if (languages_1.Language.go in config.languages &&
|
if (languages_1.Language.go in config.languages &&
|
||||||
process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG"] !== "true" &&
|
process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG"] !== "true" &&
|
||||||
!didGolangExtraction(config)) {
|
!doesGoExtractionOutputExist(config)) {
|
||||||
await (0, autobuild_1.runAutobuild)(languages_1.Language.go, config, logger);
|
await (0, autobuild_1.runAutobuild)(languages_1.Language.go, config, logger);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -100,8 +100,11 @@ function hasBadExpectErrorInput(): boolean {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for any .trap[.gz] files under the db-go/ folder
|
/**
|
||||||
function didGolangExtraction(config: Config): boolean {
|
* Returns whether any `.trap[.gz]` files exist under the `db-go` folder,
|
||||||
|
* indicating whether Go extraction has extracted at least one file.
|
||||||
|
*/
|
||||||
|
function doesGoExtractionOutputExist(config: Config): boolean {
|
||||||
const golangDbDirectory = util.getCodeQLDatabasePath(config, Language.go);
|
const golangDbDirectory = util.getCodeQLDatabasePath(config, Language.go);
|
||||||
const extractedFiles = fs
|
const extractedFiles = fs
|
||||||
.readdirSync(golangDbDirectory)
|
.readdirSync(golangDbDirectory)
|
||||||
|
|
@ -192,7 +195,7 @@ async function run() {
|
||||||
if (
|
if (
|
||||||
Language.go in config.languages &&
|
Language.go in config.languages &&
|
||||||
process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG"] !== "true" &&
|
process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG"] !== "true" &&
|
||||||
!didGolangExtraction(config)
|
!doesGoExtractionOutputExist(config)
|
||||||
) {
|
) {
|
||||||
await runAutobuild(Language.go, config, logger);
|
await runAutobuild(Language.go, config, logger);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue