From efec77e3aba25c58a239f5912733e2ecf4818fd9 Mon Sep 17 00:00:00 2001 From: linguist <22963968+lowlighter@users.noreply.github.com> Date: Sat, 2 Jan 2021 14:00:27 +0100 Subject: [PATCH] Update action --- action.yml | 2 +- source/app/action/index.mjs | 6 +++++- source/app/metrics.mjs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 29a0348d..e6ddb360 100644 --- a/action.yml +++ b/action.yml @@ -56,7 +56,7 @@ inputs: # This can used to add padding if generated image is cropped or on the contrary, remove empty space config_padding: description: Configure bottom padding - default: 2% + default: 5% # Number of repositories to use for metrics # A high number increase metrics accuracy, but will consume additional API requests when using plugins diff --git a/source/app/action/index.mjs b/source/app/action/index.mjs index 6258d77b..29d5861e 100644 --- a/source/app/action/index.mjs +++ b/source/app/action/index.mjs @@ -9,7 +9,11 @@ ;((async function () { //Input parser const input = { - get:(name) => decodeURIComponent(`${core.getInput(name)}`.trim()), + get:(name) => { + const value = `${core.getInput(name)}`.trim() + try { return decodeURIComponent(value) } + catch { return value} + }, bool:(name, {default:defaulted = undefined} = {}) => /^(?:[Tt]rue|[Oo]n|[Yy]es)$/.test(input.get(name)) ? true : /^(?:[Ff]alse|[Oo]ff|[Nn]o)$/.test(input.get(name)) ? false : defaulted, number:(name, {default:defaulted = undefined} = {}) => Number.isFinite(Number(input.get(name))) ? Number(input.get(name)) : defaulted, string:(name, {default:defaulted = undefined} = {}) => input.get(name) || defaulted, diff --git a/source/app/metrics.mjs b/source/app/metrics.mjs index 501cdc0d..760cd5ec 100644 --- a/source/app/metrics.mjs +++ b/source/app/metrics.mjs @@ -180,7 +180,7 @@ } /** Render svg */ - async function svgresize(svg, {padding = "2%", convert} = {}) { + async function svgresize(svg, {padding = "5%", convert} = {}) { //Instantiate browser if needed if (!svgresize.browser) { svgresize.browser = await puppeteer.launch({headless:true, executablePath:process.env.PUPPETEER_BROWSER_PATH, args:["--no-sandbox", "--disable-extensions", "--disable-setuid-sandbox", "--disable-dev-shm-usage"]})