From 5112b04e295a515477135147d681aabffe9c9827 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Sat, 23 Apr 2022 13:16:30 -0400 Subject: [PATCH] docs: reference the optional need of `read:packages` [skip ci] --- .github/readme/partials/documentation/setup/action.md | 1 + source/app/metrics/metadata.mjs | 2 +- source/app/web/statics/app.js | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/readme/partials/documentation/setup/action.md b/.github/readme/partials/documentation/setup/action.md index 29e2a756..e504b732 100644 --- a/.github/readme/partials/documentation/setup/action.md +++ b/.github/readme/partials/documentation/setup/action.md @@ -25,6 +25,7 @@ A a general rule, the following scopes may be required: - `read:org` for all organizations related metrics - `repo` for all private repositories related metrics - `read:user` for some private repositories related metrics +- `read:packages` for some packages related metrics - `gist` for publishing renders to gists instead of a repository > 💡 For security reasons, it is advised to always use the least amount of scopes. It is possible to prevent security issues by [forking this repository](https://github.com/lowlighter/metrics/fork) and using it in your workflow instead (more information available in step 3) diff --git a/source/app/metrics/metadata.mjs b/source/app/metrics/metadata.mjs index 978172b2..85ed773b 100644 --- a/source/app/metrics/metadata.mjs +++ b/source/app/metrics/metadata.mjs @@ -356,7 +356,7 @@ metadata.plugin = async function({__plugins, __templates, name, logger}) { `
🔑 ${{public_access:"(scopeless)"}[scope] ?? scope}`),
...Object.entries(inputs).filter(([_, {type}]) => type === "token").map(([token]) => `🗝️ ${token}`),
- ...(meta.scopes?.length ? ["read:org", "read:user", "repo"].map(scope => !meta.scopes.includes(scope) ? `${scope} (optional)` : null).filter(v => v) : []),
+ ...(meta.scopes?.length ? ["read:org", "read:user", "read:packages", "repo"].map(scope => !meta.scopes.includes(scope) ? `${scope} (optional)` : null).filter(v => v) : []),
].filter(v => v).join(" ") || "No tokens are required for this plugin"}