diff --git a/index.js b/index.js index ceaf1f0..5bc27a4 100644 --- a/index.js +++ b/index.js @@ -9,6 +9,8 @@ import core from "@actions/core"; import { makeBadge } from "badge-maker"; +const util = require('util') + const hostUrl = new URL(core.getInput("host")); // This uses the method above to update a gist with the given data. The user agent is @@ -28,7 +30,7 @@ async function updateBadge(body) { }); if (!response.ok) { - console.log(`Fetching badge failed: ${response}`); + console.log(`Fetching badge failed: ${console.log(util.inspect(response, false, null, true /* enable colors */))}`); if (response.status === 409) { // This means likely the badge already exists. Try to patch response = await fetch(hostUrl, {