fix invalid method call

This commit is contained in:
tdurieux
2021-04-30 14:21:50 +02:00
parent fa79df7efa
commit f017256d49
+4 -2
View File
@@ -134,8 +134,10 @@ module.exports.getTree = async (repoConfig, sha, truncatedTree, parentPath) => {
if (!parentPath) parentPath = ""; if (!parentPath) parentPath = "";
const token = await githubUtils.getToken(repoConfig);
const octokit = new Octokit({ const octokit = new Octokit({
auth: await githubUtils.getToken(repoConfig), auth: token,
}); });
const ghRes = await octokit.git.getTree({ const ghRes = await octokit.git.getTree({
owner: repo.owner, owner: repo.owner,
@@ -337,7 +339,7 @@ module.exports.isFilePathValid = async (options) => {
); );
if (ofs.existsSync(anonymizedFilePath)) { if (ofs.existsSync(anonymizedFilePath)) {
if (fs.lstatSync(anonymizedFilePath).isDirectory()) { if (ofs.lstatSync(anonymizedFilePath).isDirectory()) {
throw "is_folder"; throw "is_folder";
} }
return true; return true;