Merge pull request #77 from DeterminateSystems/flakehub-fallback

Gracefully handle FlakeHub login failure
This commit is contained in:
Cole Helbling 2024-05-02 07:15:43 -07:00 committed by GitHub
commit 7d2a9c4c9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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");