Skip to content

Commit

Permalink
chore: updated github api scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
pimenovoleg committed Dec 28, 2018
1 parent 474712a commit 1f4fd30
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package-lock.json

.env

# folders
node_modules/
coverage/
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"conventional-changelog": "^2.0.3",
"dgeni": "^0.4.10",
"dgeni-packages": "^0.26.12",
"dotenv": "^6.2.0",
"fs-extra": "^5.0.0",
"glob": "^7.1.3",
"gulp": "^4.0.0",
Expand Down
6 changes: 6 additions & 0 deletions tools/release/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

export const CONFIG = {
github: {
token: process.env.GITHUB_TOKEN
}
};
7 changes: 7 additions & 0 deletions tools/release/stage-release.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// tslint:disable:no-console
require('dotenv').config();

import * as OctokitApi from '@octokit/rest';
import chalk from 'chalk';
Expand All @@ -9,6 +10,7 @@ import { join } from 'path';

import { BaseReleaseTask } from './base-release-task';
import { promptAndGenerateChangelog } from './changelog';
import { CONFIG } from './config';
import { GitClient } from './git/git-client';
import { getGithubBranchCommitsUrl } from './git/github-urls';
import { promptForNewVersion } from './prompt/new-version-prompt';
Expand Down Expand Up @@ -74,6 +76,11 @@ class StageReleaseTask extends BaseReleaseTask {
}

this.githubApi = new OctokitApi();

this.githubApi.authenticate({
type: 'token',
token: CONFIG.github.token
});
}

async run() {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3305,6 +3305,11 @@ dot-prop@^4.1.1:
dependencies:
is-obj "^1.0.0"

dotenv@^6.2.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064"
integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w==

[email protected]:
version "0.0.2"
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db"
Expand Down

0 comments on commit 1f4fd30

Please sign in to comment.