@@ -28716,6 +28716,79 @@ async function codeqlDatabaseAnalyze(codeql, database_path) {
28716
28716
exports.codeqlDatabaseAnalyze = codeqlDatabaseAnalyze;
28717
28717
28718
28718
28719
+ /***/ }),
28720
+
28721
+ /***/ 1772:
28722
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
28723
+
28724
+ "use strict";
28725
+
28726
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
28727
+ if (k2 === undefined) k2 = k;
28728
+ var desc = Object.getOwnPropertyDescriptor(m, k);
28729
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
28730
+ desc = { enumerable: true, get: function() { return m[k]; } };
28731
+ }
28732
+ Object.defineProperty(o, k2, desc);
28733
+ }) : (function(o, m, k, k2) {
28734
+ if (k2 === undefined) k2 = k;
28735
+ o[k2] = m[k];
28736
+ }));
28737
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28738
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
28739
+ }) : function(o, v) {
28740
+ o["default"] = v;
28741
+ });
28742
+ var __importStar = (this && this.__importStar) || function (mod) {
28743
+ if (mod && mod.__esModule) return mod;
28744
+ var result = {};
28745
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28746
+ __setModuleDefault(result, mod);
28747
+ return result;
28748
+ };
28749
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
28750
+ exports.clonePackRepo = exports.runCommandJson = exports.runCommand = exports.newGHConfig = void 0;
28751
+ const path = __importStar(__nccwpck_require__(1017));
28752
+ const core = __importStar(__nccwpck_require__(2186));
28753
+ const toolrunner = __importStar(__nccwpck_require__(8159));
28754
+ async function newGHConfig() {
28755
+ return {
28756
+ path: "",
28757
+ };
28758
+ }
28759
+ exports.newGHConfig = newGHConfig;
28760
+ async function runCommand(config, args) {
28761
+ var bin = path.join(config.path, "gh");
28762
+ let output = "";
28763
+ var options = {
28764
+ listeners: {
28765
+ stdout: (data) => {
28766
+ output += data.toString();
28767
+ },
28768
+ },
28769
+ };
28770
+ await new toolrunner.ToolRunner(bin, args, options).exec();
28771
+ core.debug(`Finished running command :: ${bin} ${args.join(" ")}`);
28772
+ return output.trim();
28773
+ }
28774
+ exports.runCommand = runCommand;
28775
+ async function runCommandJson(config, args) {
28776
+ return JSON.parse(await runCommand(config, args));
28777
+ }
28778
+ exports.runCommandJson = runCommandJson;
28779
+ async function clonePackRepo(gh) {
28780
+ try {
28781
+ await runCommand(gh, ["repo", "clone", "GitHubSecurityLab/codeql-actions"]);
28782
+ return true;
28783
+ }
28784
+ catch (error) {
28785
+ core.warning("Failed to clone pack from GitHub...");
28786
+ }
28787
+ return false;
28788
+ }
28789
+ exports.clonePackRepo = clonePackRepo;
28790
+
28791
+
28719
28792
/***/ }),
28720
28793
28721
28794
/***/ 6144:
@@ -28751,12 +28824,17 @@ exports.run = void 0;
28751
28824
const path = __importStar(__nccwpck_require__(1017));
28752
28825
const core = __importStar(__nccwpck_require__(2186));
28753
28826
const cql = __importStar(__nccwpck_require__(950));
28827
+ const gh = __importStar(__nccwpck_require__(1772));
28754
28828
/**
28755
28829
* The main function for the action.
28756
28830
* @returns {Promise<void>} Resolves when the action is complete.
28757
28831
*/
28758
28832
async function run() {
28759
28833
try {
28834
+ // set up gh
28835
+ var ghc = await gh.newGHConfig();
28836
+ core.debug(`GH CLI found at '${ghc.path}'`);
28837
+ await gh.runCommand(ghc, ["version"]);
28760
28838
// set up codeql
28761
28839
var codeql = await cql.newCodeQL();
28762
28840
core.debug(`CodeQL CLI found at '${codeql.path}'`);
@@ -28774,10 +28852,13 @@ async function run() {
28774
28852
}
28775
28853
// download pack
28776
28854
core.info(`Downloading CodeQL Actions pack '${codeql.pack}'`);
28777
- var pack_downloaded = await cql.downloadPack(codeql);
28855
+ //var pack_downloaded = await cql.downloadPack(codeql);
28856
+ var pack_downloaded = await gh.clonePackRepo(ghc);
28778
28857
if (pack_downloaded === false) {
28779
28858
var action_path = path.resolve(path.join(__dirname, "..", "..", ".."));
28859
+ core.info(`Pack path: '${action_path}'`);
28780
28860
codeql.pack = path.join(action_path, "ql", "src");
28861
+ core.info(`Codeql pack path: '${codeql.path}'`);
28781
28862
core.info(`Pack defaulting back to local pack: '${codeql.pack}'`);
28782
28863
}
28783
28864
else {
0 commit comments