From b94281de8c738677dddd9e476a87d166a81500ac Mon Sep 17 00:00:00 2001 From: linguist <22963968+lowlighter@users.noreply.github.com> Date: Sat, 2 Jan 2021 15:30:27 +0100 Subject: [PATCH] Add repository name and update README.md --- README.md | 38 +++++++++++++++++++++++- action.yml | 2 +- source/app/metrics.mjs | 2 +- source/plugins/pagespeed/index.mjs | 2 +- source/templates/repository/image.svg | 4 +++ source/templates/repository/template.mjs | 3 ++ 6 files changed, 47 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e0d30750..904a9598 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,12 @@ But there's more with [plugins](https://github.com/lowlighter/metrics/tree/maste - + +
With charts version + + + +
@@ -664,6 +669,16 @@ Add the following to your workflow : plugin_pagespeed_screenshot: yes ``` +It is possible to audit a different website from the one linked to your GitHub account by using `plugin_pagespeed_url` option. + +Add the following to your workflow : +```yaml +- uses: lowlighter/metrics@latest + with: + # ... other options + plugin_pagespeed_url: https://******** +``` + ### 📅 Isometric calendar @@ -949,6 +964,7 @@ Add the following to your workflow instead : # ... other options plugin_topics: yes plugin_topics_mode: mastered + plugin_topics_limit: 0 ``` @@ -1080,6 +1096,16 @@ Add the following to your workflow : plugin_tweets_token: ${{ secrets.TWITTER_TOKEN }} ``` +It is possible to use a different twitter username from the one linked to your GitHub account by using `plugin_tweets_user` option. + +Add the following to your workflow : +```yaml +- uses: lowlighter/metrics@latest + with: + # ... other options + plugin_tweets_user: ******** +``` +
💬 Obtaining a twitter token @@ -1115,6 +1141,16 @@ Add the following to your workflow : plugin_posts_source: ******** ``` +It is possible to use a different username from your GitHub account by using `plugin_posts_user` option. + +Add the following to your workflow : +```yaml +- uses: lowlighter/metrics@latest + with: + # ... other options + plugin_posts_user: ******** +``` +
### 💡 Habits diff --git a/action.yml b/action.yml index 50cda9f0..0cc05fde 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: 5% + default: 6% # 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/metrics.mjs b/source/app/metrics.mjs index 760cd5ec..c2648bdd 100644 --- a/source/app/metrics.mjs +++ b/source/app/metrics.mjs @@ -180,7 +180,7 @@ } /** Render svg */ - async function svgresize(svg, {padding = "5%", convert} = {}) { + async function svgresize(svg, {padding = "6%", 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"]}) diff --git a/source/plugins/pagespeed/index.mjs b/source/plugins/pagespeed/index.mjs index 63acab28..a4c01d8a 100644 --- a/source/plugins/pagespeed/index.mjs +++ b/source/plugins/pagespeed/index.mjs @@ -3,7 +3,7 @@ //Plugin execution try { //Check if plugin is enabled and requirements are met - if ((!enabled)||(!q.pagespeed)||(!data.user.websiteUrl)) + if ((!enabled)||(!q.pagespeed)||((!data.user.websiteUrl)&&(!q["pagespeed.url"]))) return null //Parameters override let {"pagespeed.detailed":detailed = false, "pagespeed.screenshot":screenshot = false, "pagespeed.url":url = data.user.websiteUrl} = q diff --git a/source/templates/repository/image.svg b/source/templates/repository/image.svg index 7ebb3a2e..1e992a1e 100644 --- a/source/templates/repository/image.svg +++ b/source/templates/repository/image.svg @@ -22,6 +22,10 @@ <% if (base.header) { %>
+

+ + <%= user.name %> +

diff --git a/source/templates/repository/template.mjs b/source/templates/repository/template.mjs index 4b7972a9..98ffe8b7 100644 --- a/source/templates/repository/template.mjs +++ b/source/templates/repository/template.mjs @@ -56,6 +56,9 @@ await common(...arguments) await Promise.all(pending) + //Set repository name + data.user.name = `${data.user.login}/${repo}` + //Reformat projects names if (data.plugins.projects) data.plugins.projects.list?.map(project => project.name = project.name.replace(`(${login}/${repo})`, "").trim())