Skip to content

Commit

Permalink
Included all repositories and exludes ones in the big projects
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanraj13 committed May 15, 2024
1 parent 1b69fbd commit 190f6c5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ fs = require("fs");
const https = require("https");
process = require("process");
require("dotenv").config();
const bigProjects = require("./portfolio").bigProjects;

const GITHUB_TOKEN = process.env.REACT_APP_GITHUB_TOKEN;
const GITHUB_USERNAME = process.env.GITHUB_USERNAME;
Expand Down Expand Up @@ -30,7 +31,7 @@ if (USE_GITHUB_DATA === "true") {
bio
avatarUrl
location
pinnedItems(first: 6, types: [REPOSITORY]) {
repositories(first: 100, orderBy: {field: CREATED_AT, direction: DESC},privacy: PUBLIC) {
totalCount
edges {
node {
Expand Down Expand Up @@ -79,10 +80,17 @@ if (USE_GITHUB_DATA === "true") {
data += d;
});
res.on("end", () => {
fs.writeFile("./public/profile.json", data, function (err) {
if (err) return console.log(err);
console.log("saved file to public/profile.json");
const repoData = JSON.parse(responseData);


const projectNames = bigProjects.projects.map(project => project.projectName);


const filteredRepos = repoData.user.repositories.edges.filter(repo => {
return !projectNames.includes(repo.node.name);
});
setRepoFunction(filteredRepos);

});
});

Expand Down
2 changes: 1 addition & 1 deletion src/containers/projects/Projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function Projects() {
throw result;
})
.then(response => {
setrepoFunction(response.data.user.pinnedItems.edges);
setrepoFunction(response.data.user.repositories.edges);
})
.catch(function (error) {
console.error(
Expand Down

0 comments on commit 190f6c5

Please sign in to comment.