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

8
dist/index.js generated vendored
View file

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

8
dist/main.js generated vendored
View file

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

View file

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