debug logging

This commit is contained in:
softprops 2019-09-09 20:36:51 +09:00
parent d644a384fb
commit cf2aed3a12
4 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,7 @@ exports.release = (config, gh) => __awaiter(void 0, void 0, void 0, function* ()
} }
catch (error) { catch (error) {
if (error.status === 404) { if (error.status === 404) {
console.log("Creating new release...");
const tag_name = config.github_ref.replace("refs/tags/", ""); const tag_name = config.github_ref.replace("refs/tags/", "");
const name = config.input_name || tag_name; const name = config.input_name || tag_name;
const body = config.input_body; const body = config.input_body;
@ -63,6 +64,7 @@ exports.release = (config, gh) => __awaiter(void 0, void 0, void 0, function* ()
return release.data; return release.data;
} }
else { else {
console.log(`Unexpected error fetching github release for tag ${config.github_ref}: ${error}`);
throw error; throw error;
} }
} }

View File

@ -31,6 +31,7 @@ function run() {
console.log(`🎉 Release ready at ${rel.html_url}`); console.log(`🎉 Release ready at ${rel.html_url}`);
} }
catch (error) { catch (error) {
console.log(`Error: ${error}`);
core_1.setFailed(error.message); core_1.setFailed(error.message);
} }
}); });

View File

@ -66,6 +66,7 @@ export const release = async (
return release.data; return release.data;
} catch (error) { } catch (error) {
if (error.status === 404) { if (error.status === 404) {
console.log("Creating new release...");
const tag_name = config.github_ref.replace("refs/tags/", ""); const tag_name = config.github_ref.replace("refs/tags/", "");
const name = config.input_name || tag_name; const name = config.input_name || tag_name;
const body = config.input_body; const body = config.input_body;
@ -80,6 +81,7 @@ export const release = async (
}); });
return release.data; return release.data;
} else { } else {
console.log(`Unexpected error fetching github release for tag ${config.github_ref}: ${error}`);
throw error; throw error;
} }
} }

View File

@ -20,6 +20,7 @@ async function run() {
} }
console.log(`🎉 Release ready at ${rel.html_url}`) console.log(`🎉 Release ready at ${rel.html_url}`)
} catch (error) { } catch (error) {
console.log(`Error: ${error}`);
setFailed(error.message); setFailed(error.message);
} }
} }