Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { checkEverything, contains, getArgument, getDefaultLogger, gitDiff, GitDiffResult, gitStatus, GitStatusResult, joinPath, Logger, normalize, resolvePath } from "@ts-common/azure-js-dev-tools";
import * as path from "path";
import { getPackageFolderPaths } from "./common";
const logger: Logger = getDefaultLogger();
const changedFiles: string[] = [];
let headReference: string | undefined = getArgument("head-reference", { environmentVariableName: "headReference" });
if (!headReference) {
const statusResult: GitStatusResult = gitStatus();
headReference = statusResult.localBranch!;
logger.logInfo(`No head-reference argument specified on command line or in environment variables. Defaulting to "${headReference}".`);
const modifiedFiles: string[] | undefined = statusResult.modifiedFiles;
if (modifiedFiles) {
changedFiles.push(...modifiedFiles);
}
}
let baseReference: string | undefined = getArgument("base-reference", { environmentVariableName: "baseReference" });
if (!baseReference) {