From 8a3de030d1fcb83c0e594b7e46cb15183495827f Mon Sep 17 00:00:00 2001 From: dhrumit parmar Date: Mon, 24 Jun 2024 11:25:38 +0530 Subject: [PATCH] Fixing scraper-dry-run failing (Genrate markdown files) --- .github/workflows/scraper-dry-run.yaml | 2 +- scraper/src/github-scraper/fetchEvents.ts | 1 - scripts/generateNewContributors.js | 12 ++++-------- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/scraper-dry-run.yaml b/.github/workflows/scraper-dry-run.yaml index 1fd62f9a..9d49b48d 100644 --- a/.github/workflows/scraper-dry-run.yaml +++ b/.github/workflows/scraper-dry-run.yaml @@ -38,7 +38,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Generate markdown files for new contributors - run: node ../scripts/generateNewContributors.js + run: node scripts/generateNewContributors.js env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scraper/src/github-scraper/fetchEvents.ts b/scraper/src/github-scraper/fetchEvents.ts index 6e49d269..b9431ec7 100644 --- a/scraper/src/github-scraper/fetchEvents.ts +++ b/scraper/src/github-scraper/fetchEvents.ts @@ -41,7 +41,6 @@ export const fetchEvents = async ( ].includes(event.type ?? ""); if (!isBlacklisted && isRequiredEventType) { - console.log(event.type); filteredEvents.push(event); } eventsCount++; diff --git a/scripts/generateNewContributors.js b/scripts/generateNewContributors.js index 8b1633d4..2f31597a 100644 --- a/scripts/generateNewContributors.js +++ b/scripts/generateNewContributors.js @@ -18,20 +18,17 @@ Still waiting for this } const basePath = join(process.env.DATA_REPO || process.cwd()); -console.log("Base Path", process.cwd()); function getNewContributors() { let newContributors = new Set(); - fs.readdirSync(join(basePath, "../data-repo/data/github")).forEach((file) => { + fs.readdirSync(join(basePath, "data-repo/data/github")).forEach((file) => { newContributors.add(file.split(".")[0]); }); - fs.readdirSync(join(basePath, "../data-repo/contributors")).forEach( - (file) => { - newContributors.delete(file.split(".")[0]); - }, - ); + fs.readdirSync(join(basePath, "data-repo/contributors")).forEach((file) => { + newContributors.delete(file.split(".")[0]); + }); return newContributors; } @@ -46,7 +43,6 @@ function main() { } let newContributors = getNewContributors(); - console.log(newContributors); newContributors.forEach(async (value) => { // fetch the user data from the github api