@@ -32657,11 +32657,23 @@ var __webpack_exports__ = {};
3265732657
3265832658// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
3265932659var core = __nccwpck_require__(7484);
32660+ // EXTERNAL MODULE: external "os"
32661+ var external_os_ = __nccwpck_require__(857);
32662+ var external_os_default = /*#__PURE__*/__nccwpck_require__.n(external_os_);
3266032663// EXTERNAL MODULE: ./node_modules/@actions/tool-cache/lib/tool-cache.js
3266132664var tool_cache = __nccwpck_require__(3472);
3266232665;// CONCATENATED MODULE: ./src/cli-installer/cli-installer.ts
3266332666
3266432667
32668+
32669+ const archMap = {
32670+ ia32: "386",
32671+ x32: "386",
32672+ x86: "386",
32673+ x64: "amd64",
32674+ arm: "arm",
32675+ arm64: "arm64",
32676+ };
3266532677class CliInstaller {
3266632678 async install(downloadUrl) {
3266732679 console.info(`Downloading 1Password CLI from: ${downloadUrl}`);
@@ -32671,6 +32683,14 @@ class CliInstaller {
3267132683 core.addPath(extractedPath);
3267232684 core.info("1Password CLI installed");
3267332685 }
32686+ // possible values for GitHub hosted runners (process.env.RUNNER_ARCH) can be found here: https://docs.github.com/en/actions/reference/variables-reference#default-environment-variables
32687+ getArch() {
32688+ const arch = archMap[process.env.RUNNER_ARCH?.toLowerCase() || external_os_default().arch()];
32689+ if (!arch) {
32690+ throw new Error("Unsupported architecture");
32691+ }
32692+ return arch;
32693+ }
3267432694}
3267532695
3267632696;// CONCATENATED MODULE: ./src/cli-installer/linux.ts
@@ -32682,7 +32702,7 @@ class LinuxInstaller extends CliInstaller {
3268232702 constructor(version) {
3268332703 super();
3268432704 this.version = version;
32685- this.arch = this .getArch();
32705+ this.arch = super .getArch();
3268632706 }
3268732707 async installCli() {
3268832708 const downloadUrl = this.downloadUrl();
@@ -32691,21 +32711,6 @@ class LinuxInstaller extends CliInstaller {
3269132711 downloadUrl() {
3269232712 return `https://cache.agilebits.com/dist/1P/op2/pkg/${this.version}/op_linux_${this.arch}_${this.version}.zip`;
3269332713 }
32694- // return cpu architecture for the current
32695- getArch() {
32696- switch (process.env.RUNNER_ARCH) {
32697- case RunnerArch.X86:
32698- return "386";
32699- case RunnerArch.X64:
32700- return "amd64";
32701- case RunnerArch.ARM:
32702- return "arm";
32703- case RunnerArch.ARM64:
32704- return "arm64";
32705- default:
32706- throw new Error(`Unsupported RUNNER_ARCH value for linux: ${process.env.RUNNER_ARCH}`);
32707- }
32708- }
3270932714}
3271032715
3271132716// EXTERNAL MODULE: external "child_process"
@@ -32766,7 +32771,7 @@ class WindowsInstaller extends CliInstaller {
3276632771 constructor(version) {
3276732772 super();
3276832773 this.version = version;
32769- this.arch = "amd64"; // GitHub-hosted Windows runners (like windows-latest, windows-2022, windows-2019) are all 64-bit Windows Server VMs.
32774+ this.arch = super.getArch();
3277032775 }
3277132776 async installCli() {
3277232777 const downloadUrl = this.downloadUrl();
@@ -32782,15 +32787,6 @@ class WindowsInstaller extends CliInstaller {
3278232787
3278332788
3278432789/* eslint-disable @typescript-eslint/naming-convention */
32785- // Defines the architecture of the runner executing the job.
32786- // Look `RUNNER_ARCH` for possible values (https://docs.github.com/en/actions/reference/variables-reference).
32787- var RunnerArch;
32788- (function (RunnerArch) {
32789- RunnerArch["X64"] = "X64";
32790- RunnerArch["X86"] = "X86";
32791- RunnerArch["ARM"] = "ARM";
32792- RunnerArch["ARM64"] = "ARM64";
32793- })(RunnerArch || (RunnerArch = {}));
3279432790// RunnerOS defines the operating system of the runner executing the job.
3279532791// Look `RUNNER_OS` for possible values (https://docs.github.com/en/actions/reference/variables-reference).
3279632792var RunnerOS;
0 commit comments