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}) { ` ${[ ...(meta.scopes ?? []).map(scope => `🔑 ${{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"}`, " ", " ", diff --git a/source/app/web/statics/app.js b/source/app/web/statics/app.js index 85d0bcc6..21ddb9de 100644 --- a/source/app/web/statics/app.js +++ b/source/app/web/statics/app.js @@ -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`,