add modules

This commit is contained in:
Shawn Napora
2019-08-08 10:10:17 -04:00
parent 90d84dbeeb
commit 660b172085
655 changed files with 115589 additions and 21 deletions

View File

@@ -1,16 +1,16 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import * as yaml from 'js-yaml';
import {Minimatch} from 'minimatch';
import * as core from "@actions/core";
import * as github from "@actions/github";
import * as yaml from "js-yaml";
import { Minimatch } from "minimatch";
async function run() {
try {
const token = core.getInput('repo-token', {required: true});
const configPath = core.getInput('configuration-path', {required: true});
const token = core.getInput("repo-token", { required: true });
const configPath = core.getInput("configuration-path", { required: true });
const prNumber = getPrNumber();
if (!prNumber) {
console.log('Could not get pull request number from context, exiting');
console.log("Could not get pull request number from context, exiting");
return;
}
@@ -61,9 +61,9 @@ async function getChangedFiles(
const changedFiles = listFilesResponse.data.map(f => f.filename);
core.debug('found changed files:');
core.debug("found changed files:");
for (const file of changedFiles) {
core.debug(' ' + file);
core.debug(" " + file);
}
return changedFiles;
@@ -95,13 +95,13 @@ async function fetchContent(
path: repoPath
});
return Buffer.from(response.data.content, 'base64').toString();
return Buffer.from(response.data.content, "base64").toString();
}
function getLabelGlobMapFromObject(configObject: any): Map<string, string[]> {
const labelGlobs: Map<string, string[]> = new Map();
for (const label in configObject) {
if (typeof configObject[label] === 'string') {
if (typeof configObject[label] === "string") {
labelGlobs.set(label, [configObject[label]]);
} else if (configObject[label] instanceof Array) {
labelGlobs.set(label, configObject[label]);