Skip to content

Commit d9475d5

Browse files
committed
remove config dir and fix imports
1 parent c7cc040 commit d9475d5

File tree

3 files changed

+7
-32
lines changed

3 files changed

+7
-32
lines changed

.config/index.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

.config/test.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/integrations/githubOAuth.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
'use strict';
22

33
const axios = require('axios');
4-
const config = require('../../.config');
54
const { createTokenAuth } = require('@octokit/auth-token');
65

76
const host = 'https://api.github.com';
87

8+
const githubAccessTokenForMongoose = process.env.GITHUB_ACCESS_TOKEN_FOR_MONGOOSE;
9+
910
module.exports = {
1011
async createRelease(tagAndName, body) {
1112
const url = host + '/repos/Automattic/mongoose/releases';
@@ -14,7 +15,7 @@ module.exports = {
1415
name: tagAndName,
1516
body: body,
1617
};
17-
const { token } = await createTokenAuth(config.githubAccessTokenForMongoose)();
18+
const { token } = await createTokenAuth(githubAccessTokenForMongoose)();
1819
const headers = {
1920
authorization: `bearer ${token}`,
2021
accept: 'application/vnd.github.v3+json'
@@ -37,7 +38,7 @@ module.exports = {
3738
};
3839
return axios.get('https://api.github.com/user', { headers }).then(res => res.data);
3940
},
40-
getAccessToken(code) {
41+
/*getAccessToken(code) {
4142
const body = {
4243
client_id: config.githubOAuthClientId,
4344
client_secret: config.githubOAuthClientSecret,
@@ -46,7 +47,7 @@ module.exports = {
4647
const opts = { headers: { accept: 'application/json' } };
4748
return axios.post(`https://github.com/login/oauth/access_token`, body, opts).
4849
then(res => res.data);
49-
},
50+
},*/
5051
getChangelog(params) {
5152
const branch = params && params.branch || 'master';
5253
const url = host + '/repos/Automattic/mongoose/contents/CHANGELOG.md?ref=' + branch;
@@ -56,7 +57,7 @@ module.exports = {
5657
return axios.get(url, { headers }).then((res) => res.data);
5758
},
5859
async getOrganizationId(organizationName) {
59-
const { token } = await createTokenAuth(config.githubAccessTokenForMongoose)();
60+
const { token } = await createTokenAuth(githubAccessTokenForMongoose)();
6061
const headers = {
6162
authorization: `bearer ${token}`,
6263
accept: 'application/vnd.github.v3+json'
@@ -65,7 +66,7 @@ module.exports = {
6566
return axios.get(`https://api.github.com/orgs/${name}`, { headers }).then(res => res.data.id);
6667
},
6768
async getOrganizationMembers(organizationName) {
68-
const { token } = await createTokenAuth(config.githubAccessTokenForMongoose)();
69+
const { token } = await createTokenAuth(githubAccessTokenForMongoose)();
6970
const headers = {
7071
authorization: `bearer ${token}`,
7172
accept: 'application/vnd.github.v3+json'

0 commit comments

Comments
 (0)