Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

githublint

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

githublint - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

10

dist/config/default.json
{
"$schema": "../schema/githublint.schema.json#",
"aws": {
"github": {
"enabled": true
},
"respositories": [
"repositories": [
{
"name": "default",
"enabled": true,
"validations": [
{}
"branches": [
{
"name": "master"
}
]

@@ -13,0 +15,0 @@ }

1

dist/config/repository.d.ts

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc