Comparing version 1.0.1 to 1.0.2
{ | ||
"$schema": "../schema/githublint.schema.json#", | ||
"aws": { | ||
"github": { | ||
"enabled": true | ||
}, | ||
"respositories": [ | ||
"repositories": [ | ||
{ | ||
"name": "default", | ||
"enabled": true, | ||
"validations": [ | ||
{} | ||
"branches": [ | ||
{ | ||
"name": "master" | ||
} | ||
] | ||
@@ -13,0 +15,0 @@ } |
@@ -5,4 +5,5 @@ import { Config } from './config'; | ||
name: string; | ||
git: any; | ||
constructor(name: string); | ||
merge(config?: RepositoryConfig): this; | ||
} |
@@ -9,3 +9,3 @@ import { MasterConfig } from '../config'; | ||
private addRepositoriesFromConfig; | ||
private addRepositoriesFromGiuthub; | ||
private addRepositoriesFromGithub; | ||
} |
@@ -17,2 +17,5 @@ "use strict"; | ||
const chalk_1 = __importDefault(require("chalk")); | ||
const rest_1 = __importDefault(require("@octokit/rest")); | ||
const fs_extra_1 = __importDefault(require("fs-extra")); | ||
const repository_2 = require("../config/repository"); | ||
class MasterValidator extends validator_1.Validator { | ||
@@ -30,3 +33,3 @@ constructor(config) { | ||
if (this.config.aws && this.config.aws.enabled) { | ||
yield this.addRepositoriesFromGiuthub(); | ||
yield this.addRepositoriesFromGithub(); | ||
} | ||
@@ -62,4 +65,30 @@ let completedRepositories = 0; | ||
} | ||
addRepositoriesFromGiuthub() { | ||
return; | ||
addRepositoriesFromGithub() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const auth = (yield fs_extra_1.default.readFile('accesstoken.txt')).toString(); | ||
const octokit = new rest_1.default({ auth }); | ||
let page = 1; | ||
while (page > 0) { | ||
const repos = yield octokit.repos.list({ | ||
type: 'all', | ||
sort: 'full_name', | ||
direction: 'asc', | ||
per_page: 100, | ||
page | ||
}); | ||
page++; | ||
if (repos.data.length < 100) { | ||
page = 0; | ||
} | ||
for (const repo of repos.data) { | ||
console.log(chalk_1.default.gray(`Found Repo: ${repo.full_name}`)); | ||
this.repositories.push(new repository_1.RepositoryValidator(new repository_2.RepositoryConfig(repo.full_name), repo)); | ||
} | ||
} | ||
} | ||
catch (ex) { | ||
console.error(chalk_1.default.red(ex.message)); | ||
} | ||
}); | ||
} | ||
@@ -66,0 +95,0 @@ } |
@@ -5,4 +5,5 @@ import { Validator } from './validator'; | ||
name: string; | ||
constructor(config: RepositoryConfig); | ||
git: any; | ||
constructor(config: RepositoryConfig, git?: any); | ||
validate(): Promise<number>; | ||
} |
@@ -17,5 +17,6 @@ "use strict"; | ||
class RepositoryValidator extends validator_1.Validator { | ||
constructor(config) { | ||
constructor(config, git) { | ||
super(config); | ||
this.name = config.name; | ||
this.git = git; | ||
} | ||
@@ -22,0 +23,0 @@ validate() { |
{ | ||
"name": "githublint", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "XYO Internal Github Tool", | ||
@@ -33,2 +33,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@octokit/rest": "^16.23.2", | ||
"assert": "^1.4.1", | ||
@@ -40,2 +41,3 @@ "aws-sdk": "^2.431.0", | ||
"dotenv-expand": "^5.1.0", | ||
"fs-extra": "^7.0.1", | ||
"load-json-file": "^5.2.0", | ||
@@ -46,2 +48,3 @@ "lodash": "^4.17.11" | ||
"@types/aws-sdk": "^2.7.0", | ||
"@types/fs-extra": "^5.0.5", | ||
"@types/lodash": "^4.14.123", | ||
@@ -48,0 +51,0 @@ "@types/node": "^11.12.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52910
824
10
12
3
+ Added@octokit/rest@^16.23.2
+ Addedfs-extra@^7.0.1
+ Added@octokit/auth-token@2.5.05.1.1(transitive)
+ Added@octokit/core@6.1.2(transitive)
+ Added@octokit/endpoint@10.1.16.0.12(transitive)
+ Added@octokit/graphql@8.1.1(transitive)
+ Added@octokit/openapi-types@12.11.022.2.0(transitive)
+ Added@octokit/plugin-paginate-rest@1.1.2(transitive)
+ Added@octokit/plugin-request-log@1.0.4(transitive)
+ Added@octokit/plugin-rest-endpoint-methods@2.4.0(transitive)
+ Added@octokit/request@5.6.39.1.3(transitive)
+ Added@octokit/request-error@1.2.12.1.06.1.5(transitive)
+ Added@octokit/rest@16.43.2(transitive)
+ Added@octokit/types@13.6.22.16.26.41.0(transitive)
+ Added@types/node@22.10.2(transitive)
+ Addedatob-lite@2.0.0(transitive)
+ Addedbefore-after-hook@2.2.33.0.2(transitive)
+ Addedbtoa-lite@1.0.0(transitive)
+ Addedcross-spawn@6.0.6(transitive)
+ Addeddeprecation@2.3.1(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedexeca@1.0.0(transitive)
+ Addedfs-extra@7.0.1(transitive)
+ Addedget-stream@4.1.0(transitive)
+ Addedis-plain-object@5.0.0(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjsonfile@4.0.0(transitive)
+ Addedlodash.get@4.4.2(transitive)
+ Addedlodash.set@4.3.2(transitive)
+ Addedlodash.uniq@4.5.0(transitive)
+ Addedmacos-release@2.5.1(transitive)
+ Addednice-try@1.0.5(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addedoctokit-pagination-methods@1.1.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-name@3.1.0(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstrip-eof@1.0.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addeduniversal-user-agent@4.0.16.0.17.0.2(transitive)
+ Addeduniversalify@0.1.2(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwindows-release@3.3.3(transitive)
+ Addedwrappy@1.0.2(transitive)