Improve logging

This commit is contained in:
Ana Hobden 2024-02-13 11:40:27 -08:00
parent b1e40f81bd
commit 232a98572b
2 changed files with 7 additions and 5 deletions

5
dist/index.js generated vendored
View file

@ -12265,8 +12265,9 @@ async function netrcPath() {
try { try {
await flakehub_login(destinedNetrcPath); await flakehub_login(destinedNetrcPath);
} }
catch { catch (e) {
coreExports.info("FlakeHub cache disabled."); coreExports.info("FlakeHub cache disabled.");
coreExports.debug(`Error while logging into FlakeHub: ${e}`);
} }
return destinedNetrcPath; return destinedNetrcPath;
} }
@ -12277,7 +12278,7 @@ async function flakehub_login(netrc) {
`machine api.flakehub.com login flakehub password ${jwt}`, `machine api.flakehub.com login flakehub password ${jwt}`,
`machine flakehub.com login flakehub password ${jwt}`, `machine flakehub.com login flakehub password ${jwt}`,
].join("\n")); ].join("\n"));
coreExports.info("Logging in to FlakeHub."); coreExports.info("Logged in to FlakeHub.");
// the join followed by a match on ^... looks silly, but extra_config // the join followed by a match on ^... looks silly, but extra_config
// could contain multi-line values // could contain multi-line values
if (this.extra_conf?.join("\n").match(/^netrc-file/m)) { if (this.extra_conf?.join("\n").match(/^netrc-file/m)) {

View file

@ -209,8 +209,9 @@ async function netrcPath() {
const destinedNetrcPath = path.join(process.env['RUNNER_TEMP'], 'magic-nix-cache-netrc') const destinedNetrcPath = path.join(process.env['RUNNER_TEMP'], 'magic-nix-cache-netrc')
try { try {
await flakehub_login(destinedNetrcPath); await flakehub_login(destinedNetrcPath);
} catch { } catch (e) {
core.info("FlakeHub cache disabled.") core.info("FlakeHub cache disabled.");
core.debug(`Error while logging into FlakeHub: ${e}`)
} }
return destinedNetrcPath; return destinedNetrcPath;
} }
@ -227,7 +228,7 @@ async function flakehub_login(netrc: string) {
].join("\n"), ].join("\n"),
); );
core.info("Logging in to FlakeHub."); core.info("Logged in to FlakeHub.");
// the join followed by a match on ^... looks silly, but extra_config // the join followed by a match on ^... looks silly, but extra_config
// could contain multi-line values // could contain multi-line values