Skip to content

Commit 36b888e

Browse files
committed
Release v0.0.6:\n added support for safe local development, updated package.json ton include repository, homepage and bugs fields. Updated Readme.md
1 parent a39cf88 commit 36b888e

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ function main()
3333
collectStats(main);
3434
```
3535

36-
Error thrown in the passed function are still thrown out.
36+
Errors thrown in the passed function are still thrown out.
37+
38+
## Local
39+
Stats will only be collected and saved if the `CI` environment variable is set to `true` (as is the case in CI environments including Github actions).
40+
As such local runs where the `CI` environment variable is not set will not collect any data.
3741

3842
## Stats Collected
3943
The following information is collected:
@@ -57,6 +61,6 @@ Please make sure you state that you are using this package in your README as to
5761
This packages is made to work with node 12 or above.
5862

5963
## Todo
60-
- [ ] Runtime stats for debugging possible problems in runs.
64+
- [x] Runtime stats for debugging possible problems in runs.
6165
- [ ] Test on self hosted runners
6266

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ const { getActionMetadataFromDirname, getRunMetadata } = require('./utils.js');
66
*/
77
function collectStats(func) {
88
getRunMetrics(func).then(res => {
9-
sendStats(res);
9+
if ([true, 'true'].includes(process.env.CI)) {
10+
sendStats(res);
11+
}
1012
if (res.error !== undefined) {
1113
throw res.Error;
1214
}

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
22
"name": "gh-action-stats",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"description": "Library to get stats for github action runs",
5+
"homepage": "https://actions.boringday.co/get-started",
6+
"bugs": {
7+
"url": "https://github.com/michmich112/gh-action-stats-js/issues"
8+
},
59
"repository": {
610
"type": "git",
7-
"url": "github.com/michmich112/gh-action-stats-js"
11+
"url": "https://github.com/michmich112/gh-action-stats-js.git"
812
},
913
"main": "index.js",
1014
"scripts": {

0 commit comments

Comments
 (0)