Update readme and die on unhandled promises rejections
22
README.md
@@ -15,9 +15,9 @@ A GitHub Action which is run periodically at your convenience which generates an
|
||||
Assuming your username is `my-github-user`, you can embed your metrics in your personal repository's readme like below :
|
||||
```markdown
|
||||

|
||||
# Or with a redirection :
|
||||
[](https://github.com/my-github-user/my-github-user)
|
||||
```
|
||||
|
||||
Or with HTML :
|
||||
```html
|
||||
<img src="github-metrics.svg" alt="My GitHub metrics">
|
||||
```
|
||||
@@ -25,6 +25,16 @@ Assuming your username is `my-github-user`, you can embed your metrics in your p
|
||||
<details>
|
||||
<summary>💬 How to setup ?</summary>
|
||||
|
||||
#### 0. Prepare your personal repository
|
||||
|
||||
If you don't know yet or haven't done it yet, create a repository with the same name as your GitHub username.
|
||||
|
||||

|
||||
|
||||
The `README.md` of this repository will be displayed on your GitHub user profile like below !
|
||||
|
||||

|
||||
|
||||
#### 1. Create a GitHub token
|
||||
|
||||
In your account settings, go to `Developer settings` and select `Personal access tokens` to create a new token.
|
||||
@@ -113,8 +123,6 @@ For conveniency, you can use the shared instance available at [metrics.lecoq.io]
|
||||
Assuming your username is `my-github-user`, you can embed your metrics in your personal repository's readme like below :
|
||||
```markdown
|
||||

|
||||
# Or with a redirection :
|
||||
[](https://github.com/my-github-user/my-github-user)
|
||||
```
|
||||
|
||||
<details>
|
||||
@@ -326,7 +334,7 @@ These can provide more informations into your generated metrics, but it could al
|
||||
|
||||
The *pagespeed* plugin allows you to add your website performances.
|
||||
|
||||

|
||||

|
||||
|
||||
These are computed through [Google's pagespeed API](https://developers.google.com/speed/docs/insights/v5/get-started), which returns the same results as [web.dev](https://web.dev).
|
||||
|
||||
@@ -354,7 +362,7 @@ Add the following to your workflow :
|
||||
|
||||
The *lines* plugin allows you to add the number of lines of code you added and removed across your repositories.
|
||||
|
||||

|
||||

|
||||
|
||||
It will consume an additional GitHub request per repository.
|
||||
|
||||
@@ -376,7 +384,7 @@ Add the following to your workflow :
|
||||
|
||||
The *traffic* plugin allows you to add the number of pages views across your repositories.
|
||||
|
||||

|
||||

|
||||
|
||||
It will consume an additional GitHub request per repository.
|
||||
|
||||
|
||||
1
action/dist/index.js
vendored
@@ -28,6 +28,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
//Initialization
|
||||
console.log(`GitHub metrics as SVG image`)
|
||||
console.log(`========================================================`)
|
||||
process.on("unhandledRejection", error => { throw error })
|
||||
|
||||
//Load svg template, style and query
|
||||
const template = `<svg xmlns="http://www.w3.org/2000/svg" width="480" height="\${480 + (computed.plugins.pagespeed ? 100 : 0)}">
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
//Initialization
|
||||
console.log(`GitHub metrics as SVG image`)
|
||||
console.log(`========================================================`)
|
||||
process.on("unhandledRejection", error => { throw error })
|
||||
|
||||
//Load svg template, style and query
|
||||
const template = `<#include template.svg>`, style = `<#include style.css>`, query = `<#include query.graphql>`
|
||||
|
||||
BIN
docs/imgs/github_profile.png
Normal file
|
After Width: | Height: | Size: 130 KiB |
BIN
docs/imgs/personal_repo.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
BIN
docs/imgs/plugin_lines.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 17 KiB |
BIN
docs/imgs/plugin_pagespeed.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 7.4 KiB |
BIN
docs/imgs/plugin_traffic.png
Normal file
|
After Width: | Height: | Size: 15 KiB |