docs: reference the optional need of read:packages [skip ci]

This commit is contained in:
lowlighter
2022-04-23 13:16:30 -04:00
parent 846be4bb46
commit 5112b04e29
3 changed files with 6 additions and 4 deletions

View File

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

View File

@@ -356,7 +356,7 @@ metadata.plugin = async function({__plugins, __templates, name, logger}) {
` <td>${[
...(meta.scopes ?? []).map(scope => `<code>🔑 ${{public_access:"(scopeless)"}[scope] ?? scope}</code>`),
...Object.entries(inputs).filter(([_, {type}]) => type === "token").map(([token]) => `<code>🗝 ${token}</code>`),
...(meta.scopes?.length ? ["read:org", "read:user", "repo"].map(scope => !meta.scopes.includes(scope) ? `<code>${scope} (optional)</code>` : null).filter(v => v) : []),
...(meta.scopes?.length ? ["read:org", "read:user", "read:packages", "repo"].map(scope => !meta.scopes.includes(scope) ? `<code>${scope} (optional)</code>` : null).filter(v => v) : []),
].filter(v => v).join(" ") || "<i>No tokens are required for this plugin</i>"}</td>`,
" </tr>",
" <tr>",

View File

@@ -223,9 +223,10 @@
` # The following scopes are required:`,
...[...this.scopes].map(scope => ` # - ${scope}${scope === "public_access" ? " (default scope)" : ""}`),
` # The following additional scopes may be required:`,
` # - read:org (for organization related metrics)`,
` # - read:user (for user related data)`,
` # - repo (optional, if you want to include private repositories)`,
` # - read:org (for organization related metrics)`,
` # - read:user (for user related data)`,
` # - read:packages (for some packages related data)`,
` # - repo (optional, if you want to include private repositories)`,
]
: [
` # Current configuration doesn't require a GitHub token`,