Skip to content

Commit

Permalink
Fixing scraper-dry-run failing (Genrate markdown files)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgparmar14 committed Jun 24, 2024
1 parent 30b092a commit 8a3de03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scraper-dry-run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
1 change: 0 additions & 1 deletion scraper/src/github-scraper/fetchEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const fetchEvents = async (
].includes(event.type ?? "");

if (!isBlacklisted && isRequiredEventType) {
console.log(event.type);
filteredEvents.push(event);
}
eventsCount++;
Expand Down
12 changes: 4 additions & 8 deletions scripts/generateNewContributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -46,7 +43,6 @@ function main() {
}

let newContributors = getNewContributors();
console.log(newContributors);

newContributors.forEach(async (value) => {
// fetch the user data from the github api
Expand Down

0 comments on commit 8a3de03

Please sign in to comment.