Gracefully handle FlakeHub login failure

This commit is contained in:
Cole Helbling 2024-04-23 09:55:39 -07:00
parent 5c49fa4feb
commit 413ac98332
3 changed files with 23 additions and 6 deletions

10
dist/index.js generated vendored
View file

@ -97900,8 +97900,14 @@ class NixInstallerAction {
extra_conf += "\n";
}
if (this.flakehub) {
extra_conf += `netrc-file = ${await this.flakehub_login()}`;
extra_conf += "\n";
try {
const flakehub_netrc_file = await this.flakehub_login();
extra_conf += `netrc-file = ${flakehub_netrc_file}`;
extra_conf += "\n";
}
catch (e) {
core.warning(`Failed to setup FlakeHub: ${e}`);
}
}
if (this.extra_conf !== null && this.extra_conf.length !== 0) {
extra_conf += this.extra_conf.join("\n");

10
dist/main.js generated vendored
View file

@ -313,8 +313,14 @@ class NixInstallerAction {
extra_conf += "\n";
}
if (this.flakehub) {
extra_conf += `netrc-file = ${await this.flakehub_login()}`;
extra_conf += "\n";
try {
const flakehub_netrc_file = await this.flakehub_login();
extra_conf += `netrc-file = ${flakehub_netrc_file}`;
extra_conf += "\n";
}
catch (e) {
actions_core.warning(`Failed to setup FlakeHub: ${e}`);
}
}
if (this.extra_conf !== null && this.extra_conf.length !== 0) {
extra_conf += this.extra_conf.join("\n");

View file

@ -420,8 +420,13 @@ class NixInstallerAction {
extra_conf += "\n";
}
if (this.flakehub) {
extra_conf += `netrc-file = ${await this.flakehub_login()}`;
extra_conf += "\n";
try {
const flakehub_netrc_file = await this.flakehub_login();
extra_conf += `netrc-file = ${flakehub_netrc_file}`;
extra_conf += "\n";
} catch (e) {
actions_core.warning(`Failed to setup FlakeHub: ${e}`);
}
}
if (this.extra_conf !== null && this.extra_conf.length !== 0) {
extra_conf += this.extra_conf.join("\n");