@@ -29227,13 +29227,48 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"@1password/op-js","version":"
2922729227/******/ }
2922829228/******/
2922929229/************************************************************************/
29230+ /******/ /* webpack/runtime/compat get default export */
29231+ /******/ (() => {
29232+ /******/ // getDefaultExport function for compatibility with non-harmony modules
29233+ /******/ __nccwpck_require__.n = (module) => {
29234+ /******/ var getter = module && module.__esModule ?
29235+ /******/ () => (module['default']) :
29236+ /******/ () => (module);
29237+ /******/ __nccwpck_require__.d(getter, { a: getter });
29238+ /******/ return getter;
29239+ /******/ };
29240+ /******/ })();
29241+ /******/
29242+ /******/ /* webpack/runtime/define property getters */
29243+ /******/ (() => {
29244+ /******/ // define getter functions for harmony exports
29245+ /******/ __nccwpck_require__.d = (exports, definition) => {
29246+ /******/ for(var key in definition) {
29247+ /******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) {
29248+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
29249+ /******/ }
29250+ /******/ }
29251+ /******/ };
29252+ /******/ })();
29253+ /******/
29254+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
29255+ /******/ (() => {
29256+ /******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
29257+ /******/ })();
29258+ /******/
2923029259/******/ /* webpack/runtime/compat */
2923129260/******/
2923229261/******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
2923329262/******/
2923429263/************************************************************************/
2923529264var __webpack_exports__ = {};
2923629265
29266+ // EXTERNAL MODULE: external "path"
29267+ var external_path_ = __nccwpck_require__(6928);
29268+ var external_path_default = /*#__PURE__*/__nccwpck_require__.n(external_path_);
29269+ // EXTERNAL MODULE: external "url"
29270+ var external_url_ = __nccwpck_require__(7016);
29271+ var external_url_default = /*#__PURE__*/__nccwpck_require__.n(external_url_);
2923729272// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
2923829273var core = __nccwpck_require__(7484);
2923929274// EXTERNAL MODULE: ./node_modules/@actions/exec/lib/exec.js
@@ -29321,6 +29356,10 @@ const unsetPrevious = () => {
2932129356;// CONCATENATED MODULE: ./src/index.ts
2932229357
2932329358
29359+
29360+
29361+
29362+
2932429363const loadSecretsAction = async () => {
2932529364 try {
2932629365 // Get action inputs
@@ -29332,6 +29371,8 @@ const loadSecretsAction = async () => {
2933229371 }
2933329372 // Validate that a proper authentication configuration is set for the CLI
2933429373 validateAuth();
29374+ // Download and install the CLI
29375+ await installCLI();
2933529376 // Load secrets
2933629377 await loadSecrets(shouldExportEnv);
2933729378 }
@@ -29349,5 +29390,26 @@ const loadSecretsAction = async () => {
2934929390 core.setFailed(message);
2935029391 }
2935129392};
29393+ // This function's name is an exception from the naming convention
29394+ // since we refer to the 1Password CLI here.
29395+ // eslint-disable-next-line @typescript-eslint/naming-convention
29396+ const installCLI = async () => {
29397+ // validateCli checks if there's an existing 1Password CLI installed on the runner.
29398+ // If there's no CLI installed, then validateCli will throw an error, which we will use
29399+ // as an indicator that we need to execute the installation script.
29400+ await (0,dist.validateCli)().catch(async () => {
29401+ const currentFile = external_url_default().fileURLToPath(import.meta.url);
29402+ const currentDir = external_path_default().dirname(currentFile);
29403+ const parentDir = external_path_default().resolve(currentDir, "..");
29404+ // Execute bash script
29405+ const cmdOut = await exec.getExecOutput(`sh -c "` + parentDir + `/install_cli.sh"`);
29406+ // Add path to 1Password CLI to $PATH
29407+ const outArr = cmdOut.stdout.split("\n");
29408+ if (outArr[0] && process.env.PATH) {
29409+ const cliPath = outArr[0]?.replace(/^(::debug::OP_INSTALL_DIR: )/, "");
29410+ core.addPath(cliPath);
29411+ }
29412+ });
29413+ };
2935229414void loadSecretsAction();
2935329415
0 commit comments