Update README.md

This commit is contained in:
Simon Lecoq
2021-04-11 10:03:44 +02:00
parent 267d92d8e4
commit 614cb50990
14 changed files with 274 additions and 244 deletions

View File

@@ -3,11 +3,11 @@
Metrics is built to be easily customizable.
Fork this repository, switch used action from `lowlighter/metrics@latest` to your fork and start coding!
To report a bug fill an [issue](https://github.com/lowlighter/metrics/issues) describing it.
See [ARCHITECTURE.md](/ARCHITECTURE.md) for more informations about how code is structured.
To report a bug fill an [issue](https://github.com/lowlighter/metrics/issues) describing it.
To suggest new features or requesting help to setup metrics, check out [discussions](https://github.com/lowlighter/metrics/discussions).
You can also take a look at issues labeled with [help wanted](https://github.com/lowlighter/metrics/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22).
If you want to contribute, submit a [pull request](https://github.com/lowlighter/metrics/pulls).
Be sure to read [CONTRIBUTING.md](CONTRIBUTING.md) for more information about this.
If you don't know where to start, you can also take a look at issues labeled with [help wanted](https://github.com/lowlighter/metrics/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22).
Be sure to read [CONTRIBUTING.md](/CONTRIBUTING.md) for more information about this.

View File

@@ -7,41 +7,13 @@ While metrics targets mainly user accounts, it's possible to render metrics for
<details>
<summary><b>💬 Metrics for organizations</b> <i>(click to expand)</i></summary>
Setup is the same as for user accounts, though you'll need to add `read:org` scope, **whether you're member of target organization or not**.
![Add read:org scope to personal token](/.github/readme/imgs/setup_token_org_read_scope.png)
You'll also need to set `user` option with your organization name.
If you're encounting errors and your organization is using single sign-on, try to [authorize your personal token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on).
Most of plugins supported by user accounts will work with organization accounts, but note that rendering metrics for organizations consume way more APIs requests.
To support private repositories, add full `repo` scope to your personal token.
#### Example workflow
```yaml
- uses: lowlighter/metrics@latest
with:
# ... other options
token: ${{ secrets.METRICS_TOKEN }} # A personal token from an user account with read:org scope
user: organization-name # Organization name
```
<%- await include(`/partials/documentation/organizations/setup.md`) -%>
</details>
<details>
<summary><b>💬 Organizations memberships for user accounts</b> <i>(click to expand)</i></summary>
Only public memberships can be displayed by metrics by default.
You can manage your membership visibility in the `People` tab of your organization:
![Publish organization membership](/.github/readme/imgs/setup_public_membership_org.png)
For organization memberships, add `read:org` scope to your personal token.
![Add read:org scope to personal token](/.github/readme/imgs/setup_token_org_read_scope.png)
<%- await include(`/partials/documentation/organizations/memberships.md`) -%>
</details>

View File

@@ -0,0 +1,12 @@
<!-- <% if (false) { %> -->
#### 💬 Organizations memberships for user accounts
<!-- <% } %> -->
Only public memberships can be displayed by metrics by default.
You can manage your membership visibility in the `People` tab of your organization:
![Publish organization membership](/.github/readme/imgs/setup_public_membership_org.png)
For organization memberships, add `read:org` scope to your personal token.
![Add read:org scope to personal token](/.github/readme/imgs/setup_token_org_read_scope.png)

View File

@@ -0,0 +1,25 @@
<!-- <% if (false) { %> -->
#### 💬 Metrics for organizations
<!-- <% } %> -->
Setup is the same as for user accounts, though you'll need to add `read:org` scope, **whether you're member of target organization or not**.
![Add read:org scope to personal token](/.github/readme/imgs/setup_token_org_read_scope.png)
You'll also need to set `user` option with your organization name.
If you're encounting errors and your organization is using single sign-on, try to [authorize your personal token](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on).
Most of plugins supported by user accounts will work with organization accounts, but note that rendering metrics for organizations consume way more APIs requests.
To support private repositories, add full `repo` scope to your personal token.
#### Example workflow
```yaml
- uses: lowlighter/metrics@latest
with:
# ... other options
token: ${{ secrets.METRICS_TOKEN }} # A personal token from an user account with read:org scope
user: organization-name # Organization name
```

View File

@@ -2,7 +2,7 @@
Plugins are features which provide additional content and lets you customize your rendered metrics.
See their respective documentation for more informations about how to setup them:
<% { let previous = null; for (const [plugin, {name, categorie}] of Object.entries(plugins).filter(([key, value]) => value)) { %>
<% { let previous = null; for (const [plugin, {name, categorie}] of Object.entries(plugins).filter(([key, value]) => value).sort(([an, a], [bn, b]) => a.categorie === b.categorie ? an.localeCompare(bn) : 0)) { %>
<% if (previous !== categorie) { previous = categorie -%>
* **<%= `${categorie.charAt(0).toLocaleUpperCase()}${categorie.substring(1)}` %>**
<% } -%>