diff --git a/dist/index.js b/dist/index.js index 0a468f6..2533b6a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -97375,7 +97375,7 @@ class NixInstallerAction { }, }); } - catch (e) { + catch { core.debug("Docker not detected, not enabling docker shim."); return; } @@ -97595,8 +97595,14 @@ class NixInstallerAction { extraConf += "\n"; } if (this.flakehub) { - extraConf += `netrc-file = ${await this.flakehubLogin()}`; - extraConf += "\n"; + try { + const flakeHubNetrcFile = await this.flakehubLogin(); + extraConf += `netrc-file = ${flakeHubNetrcFile}`; + extraConf += "\n"; + } + catch (e) { + core.warning(`Failed to set up FlakeHub: ${e}`); + } } if (this.extraConf !== null && this.extraConf.length !== 0) { extraConf += this.extraConf.join("\n"); @@ -97821,7 +97827,7 @@ class NixInstallerAction { core.addPath(homeNixProfilePath); core.info(`Added \`${nixVarNixProfilePath}\` and \`${homeNixProfilePath}\` to \`$GITHUB_PATH\``); } - catch (error) { + catch { core.info("Skipping setting $GITHUB_PATH in action, the `nix-installer` crate seems to have done this already. From `nix-installer` version 0.11.0 and up, this step is done in the action. Prior to 0.11.0, this was only done in the `nix-installer` binary."); } } @@ -97932,7 +97938,7 @@ class NixInstallerAction { ]); return true; } - catch (error) { + catch { if (isRoot) { await exec.exec("rm", ["-f", kvmRules]); } @@ -97958,8 +97964,8 @@ class NixInstallerAction { conclusion: await this.getWorkflowConclusion(), }); } - catch (error) { - core.debug(`Error submitting post-run diagnostics report: ${error}`); + catch (e) { + core.debug(`Error submitting post-run diagnostics report: ${e}`); } } async getWorkflowConclusion() { @@ -97995,8 +98001,8 @@ class NixInstallerAction { // Assume success if no jobs failed or were canceled return "success"; } - catch (error) { - core.debug(`Error determining final disposition: ${error}`); + catch (e) { + core.debug(`Error determining final disposition: ${e}`); return "unavailable"; } } diff --git a/dist/main.js b/dist/main.js index a241929..7aa866b 100644 --- a/dist/main.js +++ b/dist/main.js @@ -114,7 +114,7 @@ class NixInstallerAction { }, }); } - catch (e) { + catch { actionsCore.debug("Docker not detected, not enabling docker shim."); return; } @@ -334,8 +334,14 @@ class NixInstallerAction { extraConf += "\n"; } if (this.flakehub) { - extraConf += `netrc-file = ${await this.flakehubLogin()}`; - extraConf += "\n"; + try { + const flakeHubNetrcFile = await this.flakehubLogin(); + extraConf += `netrc-file = ${flakeHubNetrcFile}`; + extraConf += "\n"; + } + catch (e) { + actionsCore.warning(`Failed to set up FlakeHub: ${e}`); + } } if (this.extraConf !== null && this.extraConf.length !== 0) { extraConf += this.extraConf.join("\n"); @@ -560,7 +566,7 @@ class NixInstallerAction { actionsCore.addPath(homeNixProfilePath); actionsCore.info(`Added \`${nixVarNixProfilePath}\` and \`${homeNixProfilePath}\` to \`$GITHUB_PATH\``); } - catch (error) { + catch { actionsCore.info("Skipping setting $GITHUB_PATH in action, the `nix-installer` crate seems to have done this already. From `nix-installer` version 0.11.0 and up, this step is done in the action. Prior to 0.11.0, this was only done in the `nix-installer` binary."); } } @@ -671,7 +677,7 @@ class NixInstallerAction { ]); return true; } - catch (error) { + catch { if (isRoot) { await actionsExec.exec("rm", ["-f", kvmRules]); } @@ -697,8 +703,8 @@ class NixInstallerAction { conclusion: await this.getWorkflowConclusion(), }); } - catch (error) { - actionsCore.debug(`Error submitting post-run diagnostics report: ${error}`); + catch (e) { + actionsCore.debug(`Error submitting post-run diagnostics report: ${e}`); } } async getWorkflowConclusion() { @@ -734,8 +740,8 @@ class NixInstallerAction { // Assume success if no jobs failed or were canceled return "success"; } - catch (error) { - actionsCore.debug(`Error determining final disposition: ${error}`); + catch (e) { + actionsCore.debug(`Error determining final disposition: ${e}`); return "unavailable"; } } diff --git a/src/main.ts b/src/main.ts index 202cd30..5b8a326 100644 --- a/src/main.ts +++ b/src/main.ts @@ -162,7 +162,7 @@ class NixInstallerAction { }, }, }); - } catch (e) { + } catch { actionsCore.debug("Docker not detected, not enabling docker shim."); return; } @@ -438,8 +438,13 @@ class NixInstallerAction { extraConf += "\n"; } if (this.flakehub) { - extraConf += `netrc-file = ${await this.flakehubLogin()}`; - extraConf += "\n"; + try { + const flakeHubNetrcFile = await this.flakehubLogin(); + extraConf += `netrc-file = ${flakeHubNetrcFile}`; + extraConf += "\n"; + } catch (e) { + actionsCore.warning(`Failed to set up FlakeHub: ${e}`); + } } if (this.extraConf !== null && this.extraConf.length !== 0) { extraConf += this.extraConf.join("\n"); @@ -712,7 +717,7 @@ class NixInstallerAction { actionsCore.info( `Added \`${nixVarNixProfilePath}\` and \`${homeNixProfilePath}\` to \`$GITHUB_PATH\``, ); - } catch (error) { + } catch { actionsCore.info( "Skipping setting $GITHUB_PATH in action, the `nix-installer` crate seems to have done this already. From `nix-installer` version 0.11.0 and up, this step is done in the action. Prior to 0.11.0, this was only done in the `nix-installer` binary.", ); @@ -862,7 +867,7 @@ class NixInstallerAction { ]); return true; - } catch (error) { + } catch { if (isRoot) { await actionsExec.exec("rm", ["-f", kvmRules]); } else { @@ -888,10 +893,8 @@ class NixInstallerAction { this.idslib.recordEvent(EVENT_CONCLUDE_WORKFLOW, { conclusion: await this.getWorkflowConclusion(), }); - } catch (error) { - actionsCore.debug( - `Error submitting post-run diagnostics report: ${error}`, - ); + } catch (e) { + actionsCore.debug(`Error submitting post-run diagnostics report: ${e}`); } } @@ -938,8 +941,8 @@ class NixInstallerAction { // Assume success if no jobs failed or were canceled return "success"; - } catch (error) { - actionsCore.debug(`Error determining final disposition: ${error}`); + } catch (e) { + actionsCore.debug(`Error determining final disposition: ${e}`); return "unavailable"; } }