@@ -28613,13 +28613,14 @@ async function newCodeQL() {
28613
28613
};
28614
28614
}
28615
28615
exports.newCodeQL = newCodeQL;
28616
- async function runCommand(config, args, cwd ) {
28616
+ async function runCommand(config, args, cwd_arg ) {
28617
28617
var bin = path.join(config.path, "codeql");
28618
28618
let output = "";
28619
- var _cwd = process.cwd();
28620
- if (cwd ) {
28621
- _cwd = cwd ;
28619
+ var cwd = process.cwd();
28620
+ if (cwd_arg ) {
28621
+ cwd = cwd_arg ;
28622
28622
}
28623
+ core.info("Current working directory: " + cwd);
28623
28624
var options = {
28624
28625
cwd: cwd,
28625
28626
listeners: {
@@ -28674,11 +28675,10 @@ async function downloadPack(codeql) {
28674
28675
return false;
28675
28676
}
28676
28677
exports.downloadPack = downloadPack;
28677
- async function installPack(codeql, path ) {
28678
+ async function installPack(codeql, dir ) {
28678
28679
try {
28679
- await runCommand(codeql, ["pack", "install"], path);
28680
- await runCommand(codeql, ["pack", "install"], path);
28681
- core.info("Installed local packs ...");
28680
+ await runCommand(codeql, ["pack", "install"], path.join(dir, "/ql/lib"));
28681
+ await runCommand(codeql, ["pack", "install"], path.join(dir, "/ql/src"));
28682
28682
return true;
28683
28683
}
28684
28684
catch (error) {
@@ -28771,7 +28771,7 @@ const core = __importStar(__nccwpck_require__(2186));
28771
28771
const toolrunner = __importStar(__nccwpck_require__(8159));
28772
28772
async function newGHConfig() {
28773
28773
return {
28774
- path: "",
28774
+ path: "/usr/bin/ ",
28775
28775
};
28776
28776
}
28777
28777
exports.newGHConfig = newGHConfig;
@@ -28874,21 +28874,23 @@ async function run() {
28874
28874
throw new Error("CodeQL Yaml extractor not installed");
28875
28875
}
28876
28876
// download pack
28877
- core.info(`Downloading CodeQL Actions pack '${codeql.pack}'`);
28878
- //var pack_downloaded = await cql.downloadPack(codeql);
28877
+ // core.info(`Downloading CodeQL Actions pack '${codeql.pack}'`);
28878
+ // var pack_downloaded = await cql.downloadPack(codeql);
28879
+ core.info(`Cloning CodeQL Actions pack into '${codeql.pack}'`);
28879
28880
let pack_path = "/tmp/codeql-actions";
28880
- var pack_downloaded = await gh.clonePackRepo(ghc, pack_path);
28881
- await cql.installPack(codeql, pack_path);
28882
- if (pack_downloaded === false) {
28883
- var action_path = path.resolve(path.join(__dirname, "..", "..", ".."));
28884
- core.info(`Pack path: '${action_path}'`);
28885
- codeql.pack = path.join(action_path, "ql", "src");
28886
- core.info(`Codeql pack path: '${codeql.path}'`);
28887
- core.info(`Pack defaulting back to local pack: '${codeql.pack}'`);
28888
- }
28889
- else {
28890
- core.info(`Pack downloaded '${codeql.pack}'`);
28891
- }
28881
+ var pack_cloned = await gh.clonePackRepo(ghc, pack_path);
28882
+ core.info(`Cloned CodeQL Actions pack into '${pack_path}'`);
28883
+ if (pack_cloned === false) {
28884
+ throw new Error("Could not clone the actions ql pack");
28885
+ }
28886
+ core.info(`Installing CodeQL Actions packs from '${pack_path}'`);
28887
+ var pack_installed = await cql.installPack(codeql, pack_path);
28888
+ if (pack_installed === false) {
28889
+ throw new Error("Could not install the actions ql packs");
28890
+ }
28891
+ core.info(`Pack path: '${pack_path}'`);
28892
+ codeql.pack = path.join(pack_path, "ql", "src");
28893
+ core.info(`Codeql Queries pack path: '${codeql.pack}'`);
28892
28894
core.info("Creating CodeQL database...");
28893
28895
var database_path = await cql.codeqlDatabaseCreate(codeql);
28894
28896
core.info("Running CodeQL analysis...");
@@ -30815,4 +30817,4 @@ module.exports = parseParams
30815
30817
/******/ module.exports = __webpack_exports__;
30816
30818
/******/
30817
30819
/******/ })()
30818
- ;
30820
+ ;
0 commit comments