fix(ci): update some parameters [skip ci]
This commit is contained in:
@@ -268,6 +268,30 @@ metadata.plugin = async function({__plugins, name, logger}) {
|
||||
const raw = `${await fs.promises.readFile(path.join(__plugins, name, "README.md"), "utf-8")}`
|
||||
const demo = raw.match(/(?<demo><table>[\s\S]*?<[/]table>)/)?.groups?.demo?.replace(/<[/]?(?:table|tr)>/g, "")?.trim() ?? "<td></td>"
|
||||
|
||||
//Header table
|
||||
const header = [
|
||||
"<table>",
|
||||
` <tr><th colspan="2"><h3>${meta.name}</h3></th></tr>`,
|
||||
` <tr><td colspan="2" align="center">${(meta.description ?? "").replaceAll("\n", "<br>")}</td></tr>`,
|
||||
" <tr>",
|
||||
' <th rowspan="3">Supported features<br><sub><a href="metadata.yml">→ Full specification</a></sub></th>',
|
||||
//` <td>${Object.entries(compatibility).filter(([_, value]) => value).map(([id]) => `<a href="/source/plugins/${id}" title="${plugins[id].name}">${plugins[id].icon}</a>`).join(" ")}${meta.formats?.includes("markdown") ? " <code>✓ embed()</code>" : ""}</td>`,
|
||||
" </tr>",
|
||||
" <tr>",
|
||||
` <td>${[
|
||||
meta.supports?.includes("user") ? "👤 Users" : "",
|
||||
meta.supports?.includes("organization") ? "👥 Organizations" : "",
|
||||
meta.supports?.includes("repository") ? "📓 Repositories" : ""
|
||||
].filter(v => v).join(", ")}</td>`,
|
||||
" </tr>",
|
||||
" <tr>",
|
||||
` <td>${[...(meta.scopes ?? []).map(scope => `🔑 ${scope}`), ...Object.entries(inputs).filter(([_, {type}]) => type === "token").map(([token]) => `<code>🗝️ ${token}</code>`)].join(", ")}</td>`,
|
||||
" </tr>",
|
||||
" <tr>",
|
||||
" </tr>",
|
||||
"</table>"
|
||||
].join("\n")
|
||||
|
||||
//Options table
|
||||
let flags = new Set()
|
||||
const table = [
|
||||
@@ -348,7 +372,7 @@ metadata.plugin = async function({__plugins, name, logger}) {
|
||||
].flat(Infinity).filter(s => s).join("\n")
|
||||
|
||||
//Readme descriptor
|
||||
meta.readme = {demo, table}
|
||||
meta.readme = {demo, table, header}
|
||||
}
|
||||
|
||||
//Icon
|
||||
@@ -368,7 +392,6 @@ metadata.template = async function({__templates, name, plugins, logger}) {
|
||||
try {
|
||||
//Load meta descriptor
|
||||
const raw = fs.existsSync(path.join(__templates, name, "metadata.yml")) ? `${await fs.promises.readFile(path.join(__templates, name, "metadata.yml"), "utf-8")}` : ""
|
||||
const readme = fs.existsSync(path.join(__templates, name, "README.md")) ? `${await fs.promises.readFile(path.join(__templates, name, "README.md"), "utf-8")}` : ""
|
||||
const meta = yaml.load(raw) ?? {}
|
||||
|
||||
//Compatibility
|
||||
@@ -383,7 +406,7 @@ metadata.template = async function({__templates, name, plugins, logger}) {
|
||||
}
|
||||
|
||||
//Demo for main and individual readmes
|
||||
function demo({colspan = null} = {}) {
|
||||
function demo({colspan = null} = {}) { //eslint-disable-line no-inner-declarations
|
||||
return [
|
||||
` <td ${colspan ? `colspan="${colspan}"` : ""} align="center">`,
|
||||
`${Object.entries(meta.examples ?? {}).map(([text, link]) => {
|
||||
@@ -394,8 +417,8 @@ metadata.template = async function({__templates, name, plugins, logger}) {
|
||||
}
|
||||
return ` ${img}`
|
||||
}).join("\n")}`,
|
||||
` <img width="900" height="1" alt="">`,
|
||||
` </td>`
|
||||
' <img width="900" height="1" alt="">',
|
||||
" </td>"
|
||||
].join("\n")
|
||||
}
|
||||
|
||||
@@ -404,18 +427,18 @@ metadata.template = async function({__templates, name, plugins, logger}) {
|
||||
"<table>",
|
||||
` <tr><th colspan="2"><h3>${meta.name ?? "(unnamed template)"}</h3></th></tr>`,
|
||||
` <tr><td colspan="2" align="center">${(meta.description ?? "").replaceAll("\n", "<br>")}</td></tr>`,
|
||||
` <tr>`,
|
||||
` <th rowspan="3">Supported features<br><sub><a href="metadata.yml">→ Full specification</a></sub></th>`,
|
||||
" <tr>",
|
||||
' <th rowspan="3">Supported features<br><sub><a href="metadata.yml">→ Full specification</a></sub></th>',
|
||||
` <td>${Object.entries(compatibility).filter(([_, value]) => value).map(([id]) => `<a href="/source/plugins/${id}" title="${plugins[id].name}">${plugins[id].icon}</a>`).join(" ")}${meta.formats?.includes("markdown") ? " <code>✓ embed()</code>" : ""}</td>`,
|
||||
` </tr>`,
|
||||
` <tr>`,
|
||||
" </tr>",
|
||||
" <tr>",
|
||||
` <td>${[
|
||||
meta.supports?.includes("user") ? "👤 Users" : "",
|
||||
meta.supports?.includes("organization") ? "👥 Organizations" : "",
|
||||
meta.supports?.includes("repository") ? "📓 Repositories" : ""
|
||||
].filter(v => v).join(", ")}</td>`,
|
||||
` </tr>`,
|
||||
` <tr>`,
|
||||
" </tr>",
|
||||
" <tr>",
|
||||
` <td>${[
|
||||
meta.formats?.includes("svg") ? "*️⃣ SVG" : "",
|
||||
meta.formats?.includes("png") ? "*️⃣ PNG" : "",
|
||||
@@ -424,10 +447,10 @@ metadata.template = async function({__templates, name, plugins, logger}) {
|
||||
meta.formats?.includes("markdown") ? "🔠 Markdown" : "",
|
||||
meta.formats?.includes("markdown-pdf") ? "🔠 Markdown (PDF)" : "",
|
||||
].filter(v => v).join(", ")}</td>`,
|
||||
` </tr>`,
|
||||
` <tr>`,
|
||||
" </tr>",
|
||||
" <tr>",
|
||||
demo({colspan:2}),
|
||||
` </tr>`,
|
||||
" </tr>",
|
||||
"</table>"
|
||||
].join("\n")
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
with:
|
||||
filename: metrics.organization.svg
|
||||
user: github
|
||||
token: ${{ secrets.METRICS_BOT_TOKEN }}
|
||||
token: ${{ secrets.METRICS_TOKEN_WITH_SCOPES }}
|
||||
base: header, repositories
|
||||
|
||||
- name: Large display
|
||||
|
||||
@@ -32,7 +32,7 @@ It is mostly intended for metrics used outside of GitHub, since these informatio
|
||||
|
||||
<!--examples-->
|
||||
```yaml
|
||||
name: User introduction
|
||||
name: Organization introduction
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
filename: metrics.plugin.introduction.svg
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
- name: User introduction
|
||||
- name: Organization introduction
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
filename: metrics.plugin.introduction.svg
|
||||
@@ -8,7 +8,7 @@
|
||||
plugin_introduction: yes
|
||||
prod:
|
||||
with:
|
||||
token: ${{ secrets.METRICS_BOT_TOKEN }}
|
||||
token: ${{ secrets.METRICS_TOKEN_WITH_SCOPES }}
|
||||
|
||||
- name: Repository introduction
|
||||
uses: lowlighter/metrics@latest
|
||||
|
||||
@@ -63,6 +63,8 @@
|
||||
plugin_music: yes
|
||||
plugin_music_mode: recent
|
||||
plugin_music_provider: youtube
|
||||
prod:
|
||||
skip: true
|
||||
|
||||
- name: Last.fm - Recently listed
|
||||
uses: lowlighter/metrics@latest
|
||||
@@ -71,4 +73,6 @@
|
||||
plugin_music_token: ${{ secrets.LASTFM_TOKEN }}
|
||||
plugin_music: yes
|
||||
plugin_music_provider: lastfm
|
||||
plugin_music_user: RJ
|
||||
plugin_music_user: RJ
|
||||
prod:
|
||||
skip: true
|
||||
@@ -55,6 +55,7 @@ with:
|
||||
token: NOT_NEEDED
|
||||
plugin_pagespeed: 'yes'
|
||||
plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }}
|
||||
plugin_pagespeed_url: https://lecoq.io
|
||||
|
||||
```
|
||||
```yaml
|
||||
@@ -66,6 +67,7 @@ with:
|
||||
plugin_pagespeed: 'yes'
|
||||
plugin_pagespeed_detailed: 'yes'
|
||||
plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }}
|
||||
plugin_pagespeed_url: https://lecoq.io
|
||||
|
||||
```
|
||||
```yaml
|
||||
@@ -77,6 +79,7 @@ with:
|
||||
plugin_pagespeed: 'yes'
|
||||
plugin_pagespeed_screenshot: 'yes'
|
||||
plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }}
|
||||
plugin_pagespeed_url: https://lecoq.io
|
||||
|
||||
```
|
||||
<!--/examples-->
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
token: NOT_NEEDED
|
||||
plugin_pagespeed: yes
|
||||
plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }}
|
||||
plugin_pagespeed_url: https://lecoq.io
|
||||
|
||||
- name: Detailed report
|
||||
uses: lowlighter/metrics@latest
|
||||
@@ -14,6 +15,7 @@
|
||||
plugin_pagespeed: yes
|
||||
plugin_pagespeed_detailed: yes
|
||||
plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }}
|
||||
plugin_pagespeed_url: https://lecoq.io
|
||||
|
||||
- name: Screenshot
|
||||
uses: lowlighter/metrics@latest
|
||||
@@ -23,4 +25,5 @@
|
||||
plugin_pagespeed: yes
|
||||
plugin_pagespeed_screenshot: yes
|
||||
plugin_pagespeed_token: ${{ secrets.PAGESPEED_TOKEN }}
|
||||
plugin_pagespeed_url: https://lecoq.io
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ name: Project from a repository
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
filename: metrics.plugin.projects.svg
|
||||
token: ${{ secrets.METRICS_BOT_TOKEN }}
|
||||
token: ${{ secrets.METRICS_TOKEN_WITH_SCOPES }}
|
||||
base: ''
|
||||
plugin_projects: 'yes'
|
||||
plugin_projects_repositories: lowlighter/metrics/projects/1
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
filename: metrics.plugin.projects.svg
|
||||
token: ${{ secrets.METRICS_BOT_TOKEN }}
|
||||
token: ${{ secrets.METRICS_TOKEN_WITH_SCOPES }}
|
||||
base: ""
|
||||
plugin_projects: yes
|
||||
plugin_projects_repositories: lowlighter/metrics/projects/1
|
||||
|
||||
@@ -47,7 +47,7 @@ with:
|
||||
token: NOT_NEEDED
|
||||
base: ''
|
||||
plugin_stock: 'yes'
|
||||
plugin_stock_token: ${{ secrets.RAPIDAPI_TOKEN }}
|
||||
plugin_stock_token: ${{ secrets.STOCK_TOKEN }}
|
||||
plugin_stock_symbol: TSLA
|
||||
|
||||
```
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
token: NOT_NEEDED
|
||||
base: ""
|
||||
plugin_stock: yes
|
||||
plugin_stock_token: ${{ secrets.RAPIDAPI_TOKEN }}
|
||||
plugin_stock_token: ${{ secrets.STOCK_TOKEN }}
|
||||
plugin_stock_symbol: TSLA
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
plugin_traffic: yes
|
||||
prod:
|
||||
with:
|
||||
token: ${{ secrets.METRICS_BOT_TOKEN }}
|
||||
token: ${{ secrets.METRICS_TOKEN_WITH_SCOPES }}
|
||||
@@ -6,9 +6,6 @@
|
||||
plugin_tweets: yes
|
||||
plugin_tweets_token: ${{ secrets.TWITTER_TOKEN }}
|
||||
plugin_tweets_user: github
|
||||
prod:
|
||||
with:
|
||||
user: botlighter
|
||||
|
||||
- name: Latest tweets including attachments
|
||||
uses: lowlighter/metrics@latest
|
||||
@@ -19,7 +16,3 @@
|
||||
plugin_tweets_token: ${{ secrets.TWITTER_TOKEN }}
|
||||
plugin_tweets_attachments: yes
|
||||
plugin_tweets_user: github
|
||||
prod:
|
||||
with:
|
||||
user: botlighter
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ uses: lowlighter/metrics@latest
|
||||
with:
|
||||
template: repository
|
||||
filename: metrics.repository.svg
|
||||
token: ${{ secrets.METRICS_BOT_TOKEN }}
|
||||
token: ${{ secrets.METRICS_TOKEN_WITH_SCOPES }}
|
||||
user: lowlighter
|
||||
repo: metrics
|
||||
plugin_lines: 'yes'
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
with:
|
||||
template: repository
|
||||
filename: metrics.repository.svg
|
||||
token: ${{ secrets.METRICS_BOT_TOKEN }}
|
||||
token: ${{ secrets.METRICS_TOKEN_WITH_SCOPES }}
|
||||
user: lowlighter
|
||||
repo: metrics
|
||||
plugin_lines: yes
|
||||
|
||||
Reference in New Issue
Block a user