Skip to content
This repository was archived by the owner on Apr 11, 2022. It is now read-only.

Commit ec1d658

Browse files
committedOct 12, 2020
add github token as env varaible for CI
1 parent 02b54f9 commit ec1d658

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
 

‎.travis.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ node_js:
88
- '12'
99
- '10'
1010
before_install:
11-
- chmod +x ./bin/index.js
11+
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then chmod +x ./bin/index.js ; fi
12+
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then chmod +x ./bin/index.js ; fi

‎lib/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
'use strict';
2+
require('dotenv').config();
23
const {Octokit} = require('@octokit/rest');
34
const isEmpty = require('lodash.isempty');
45
const chalk = require('chalk');
@@ -100,7 +101,9 @@ module.exports = async options => {
100101
* @Todo
101102
* Adding auth token as argument is supported but not making it available in the cli version for now.
102103
*/
103-
const octokit = new Octokit();
104+
const octokit = new Octokit({
105+
auth: process.env.GITHUB_TOKEN
106+
});
104107

105108
const feedActivites = await octokit.request('GET /users/{username}/received_events', {
106109
username,

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
},
3939
"devDependencies": {
4040
"ava": "2.4.0",
41+
"dotenv": "^8.2.0",
4142
"execa": "^4.0.3",
4243
"xo": "^0.33.1"
4344
},

0 commit comments

Comments
 (0)