Walk log filex manually rather than using the Actions globber.
This commit is contained in:
parent
219142571c
commit
8705aaff32
38 changed files with 41 additions and 1367 deletions
25
lib/analyze-action.js
generated
25
lib/analyze-action.js
generated
|
|
@ -10,7 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const glob = __importStar(require("@actions/glob"));
|
||||
const actionsUtil = __importStar(require("./actions-util"));
|
||||
const analyze_1 = require("./analyze");
|
||||
const config_utils_1 = require("./config-utils");
|
||||
|
|
@ -72,16 +71,22 @@ async function run() {
|
|||
if (core.isDebug() && config !== undefined) {
|
||||
core.info("Debug mode is on. Printing CodeQL debug logs...");
|
||||
for (const language of config.languages) {
|
||||
const logsDirectory = util.getCodeQLDatabasePath(config.tempDir, language);
|
||||
const logGlobber = await glob.create(path.join(logsDirectory, "log", "**"));
|
||||
const logFiles = await logGlobber.glob();
|
||||
for (const logFile of logFiles) {
|
||||
if (fs.statSync(logFile).isFile()) {
|
||||
core.startGroup(`CodeQL Debug Logs - ${language} - ${logFile}`);
|
||||
process.stderr.write(fs.readFileSync(logFile));
|
||||
core.endGroup();
|
||||
const databaseDirectory = util.getCodeQLDatabasePath(config.tempDir, language);
|
||||
const logsDirectory = path.join(databaseDirectory, "log");
|
||||
const walkLogFiles = (dir) => {
|
||||
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
||||
for (const entry of entries) {
|
||||
if (entry.isFile()) {
|
||||
core.startGroup(`CodeQL Debug Logs - ${language} - ${entry.name}`);
|
||||
process.stderr.write(fs.readFileSync(path.resolve(dir, entry.name)));
|
||||
core.endGroup();
|
||||
}
|
||||
else if (entry.isDirectory()) {
|
||||
walkLogFiles(path.resolve(dir, entry.name));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
walkLogFiles(logsDirectory);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue