Update action

This commit is contained in:
linguist
2021-01-02 14:00:27 +01:00
parent f55176f7b9
commit efec77e3ab
3 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -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,

View File

@@ -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"]})