diff --git a/source/app/action/index.mjs b/source/app/action/index.mjs index df44c023..70a612bc 100644 --- a/source/app/action/index.mjs +++ b/source/app/action/index.mjs @@ -50,7 +50,7 @@ //Core inputs const { - user:_user, token, + user:_user, repo:_repo, token, template, query, "setup.community.templates":_templates, filename, optimize, verify, debug, "debug.flags":dflags, "use.mocked.data":mocked, dryrun, @@ -59,7 +59,7 @@ "use.prebuilt.image":_image, ...config } = metadata.plugins.core.inputs.action({core}) - const q = {...query, template} + const q = {...query, repo:_repo, template} //Docker image if (_image) @@ -101,6 +101,8 @@ } const user = _user || authenticated info("GitHub account", user) + if (q.repo) + info("GitHub repository", `${user}/${q.repo}`) //Current repository info("Current repository", `${github.context.repo.owner}/${github.context.repo.repo}`) diff --git a/source/plugins/core/metadata.yml b/source/plugins/core/metadata.yml index 4d44cd78..1efed89a 100644 --- a/source/plugins/core/metadata.yml +++ b/source/plugins/core/metadata.yml @@ -18,16 +18,26 @@ inputs: required: true # GitHub username + # Defaults to "token" owner user: description: GitHub username type: string - default: "" # Defaults to "token" owner + default: "" - # Set to "${{ secrets.GITHUB_TOKEN }}" + # GitHub repository + # Compute metrics for a repository instead ("user" being the repository owner) + # Check https://github.com/lowlighter/metrics/blob/master/source/templates/repository/README.md for more informations + repo: + description: GitHub repository + type: string + default: "" + + # Set to "${{ github.token }}" or "${{ secrets.GITHUB_TOKEN }}" + # GITHUB_TOKEN is a special auto-generated token restricted to current repository, which is used to push files in it committer_token: description: GitHub Token used to commit metrics type: token - default: "" # Defaults to "token" + default: ${{ github.token }} # Branch used to commit rendered metrics committer_branch: