From 4fc8ab8fcf9e0c5563317c09b6773b9d41f2075a Mon Sep 17 00:00:00 2001
From: lowlighter <22963968+lowlighter@users.noreply.github.com>
Date: Sat, 15 Jan 2022 22:36:41 -0500
Subject: [PATCH] doc(plugins/contributors): update
---
source/plugins/contributors/README.md | 108 +++++++++++++----------
source/plugins/contributors/metadata.yml | 46 +++++-----
2 files changed, 86 insertions(+), 68 deletions(-)
diff --git a/source/plugins/contributors/README.md b/source/plugins/contributors/README.md
index 1f7a995f..61145f1d 100644
--- a/source/plugins/contributors/README.md
+++ b/source/plugins/contributors/README.md
@@ -1,40 +1,29 @@
-### đ
Repository contributors
-
-The *contributors* plugin lets you display repositories contributors from a commit range, that can be specified through either sha, tags, branch, etc.
-
-It's especially useful to acknowledge contributors on release notes.
-
+
@@ -43,7 +32,7 @@ Matching is performed in keys order.
plugin_contributors |
- Display repository contributors
+ | Enable contributors plugin
![]() |
@@ -53,7 +42,7 @@ Matching is performed in keys order.
plugin_contributors_base |
- Base reference
+ | Base reference (commit, tag, branch, etc.)
![]() |
@@ -62,7 +51,7 @@ Matching is performed in keys order.
plugin_contributors_head |
- Head reference
+ | Head reference (commit, tag, branch, etc.)
![]() |
@@ -72,19 +61,19 @@ Matching is performed in keys order.
plugin_contributors_ignored |
- Contributors to ignore
+ | Ignored users
+Useful to ignore bots activity
![]() |
⊠Inherits users_ignored
type: array
(comma-separated)
-
-default: github-actions[bot], dependabot[bot], dependabot-preview[bot]
|
+
plugin_contributors_contributions |
- Display contributions
+ | Toggle number of contributions display
![]() |
@@ -94,7 +83,11 @@ Matching is performed in keys order.
plugin_contributors_sections |
- Sections to display
+ | Displayed sections
+
+contributors: all contributors
+categories: contributors sorted by contributions categories
+
![]() |
@@ -106,7 +99,9 @@ Matching is performed in keys order.
plugin_contributors_categories |
- Contributions categories
+ | Configure contribution categories
+This option required plugin_contributors_sections to have categories in it to be effective
+Pass a JSON object mapping category with fileglobs
![]() |
@@ -123,9 +118,30 @@ Matching is performed in keys order.
-*[â Full specification](metadata.yml)*
+## đī¸ Setting up contribution categories
-#### âšī¸ Examples workflows
+Pass a JSON object to `plugin_contributors_categories` with categories names as keys and arrays of fileglobs as values to configure contributions categories.
+
+Each modified file by a contributor matching a fileglob will add them in said category.
+
+> đĄ File matching respect keys order
+
+> đĄ Use `|` YAML multiline operator for better readability
+
+*Example: *
+```yaml
+- uses: lowlighter/metrics@latest
+ with:
+ plugin_contributors: yes
+ plugin_contributors_categories: |
+ {
+ "đ Documentation": ["README.md", "docs/**"],
+ "đģ Code": ["source/**", "src/**"],
+ "#ī¸âŖ Others": ["*"]
+ }
+```
+
+## âšī¸ Examples workflows
```yaml
@@ -160,4 +176,4 @@ with:
}
```
-
\ No newline at end of file
+
diff --git a/source/plugins/contributors/metadata.yml b/source/plugins/contributors/metadata.yml
index 24caa471..5e0fc9b9 100644
--- a/source/plugins/contributors/metadata.yml
+++ b/source/plugins/contributors/metadata.yml
@@ -1,5 +1,9 @@
name: "đ
Repository contributors"
category: github
+description: This plugin display repositories contributors from a commit range along with additional stats.
+examples:
+ +by contribution types: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.contributors.categories.svg
+ by number of contributions: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.contributors.contributions.svg
index: 6
supports:
- repository
@@ -7,58 +11,56 @@ scopes:
- public_access
inputs:
- # Enable or disable plugin
plugin_contributors:
- description: Display repository contributors
+ description: Enable contributors plugin
type: boolean
default: no
- # Base reference (commit, tag, branch, etc.)
plugin_contributors_base:
- description: Base reference
+ description: Base reference (commit, tag, branch, etc.)
type: string
default: ""
example: commit, tag or branch
- # Head reference (commit, tag, branch, etc.)
plugin_contributors_head:
- description: Head reference
+ description: Head reference (commit, tag, branch, etc.)
type: string
default: master
- # Ignored contributors (useful to ignore bots users)
plugin_contributors_ignored:
- description: Contributors to ignore
+ description: |
+ Ignored users
+
+ Useful to ignore bots activity
type: array
format: comma-separated
- default: github-actions[bot], dependabot[bot], dependabot-preview[bot]
+ default: ""
inherits: users_ignored
- # Display total contributions for each contributor
plugin_contributors_contributions:
- description: Display contributions
+ description: Toggle number of contributions display
type: boolean
default: no
- # Sections to display
plugin_contributors_sections:
- description: Sections to display
+ description: |
+ Displayed sections
+ - `contributors`: all contributors
+ - `categories`: contributors sorted by contributions categories
type: array
format: comma-separated
default: contributors
example: contributors
values:
- - contributors # Display all contributors
- - categories # Display contributors per contributions categories
+ - contributors
+ - categories
- # Contributions categories
- # This requires "plugin_contributors_sections" to have "categories" in it to be effective
- #
- # Pass a JSON object which contains a mapping of category with fileglobs.
- # Contributors will be sorted into each category to reflect their contributions.
- # Note that order a file will only match the first category matching
plugin_contributors_categories:
- description: Contributions categories
+ description: |
+ Configure contribution categories
+
+ This option required `plugin_contributors_sections` to have `categories` in it to be effective
+ Pass a JSON object mapping category with fileglobs
type: json
default: |
{