From 188b6288976c4adf0e2c219ab14470898f76a81d Mon Sep 17 00:00:00 2001 From: Akib Mohaimenur Rahman Date: Fri, 19 Mar 2021 15:58:48 -0400 Subject: [PATCH 1/5] Moved all data coming from external sourcse into _data/external --- _data/{ => external}/_wins-data.json | 0 _data/{ => external}/github-data.json | 0 _data/{ => external}/vrms_data.json | 0 _data/{ => external}/wins-data.json | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename _data/{ => external}/_wins-data.json (100%) rename _data/{ => external}/github-data.json (100%) rename _data/{ => external}/vrms_data.json (100%) rename _data/{ => external}/wins-data.json (100%) diff --git a/_data/_wins-data.json b/_data/external/_wins-data.json similarity index 100% rename from _data/_wins-data.json rename to _data/external/_wins-data.json diff --git a/_data/github-data.json b/_data/external/github-data.json similarity index 100% rename from _data/github-data.json rename to _data/external/github-data.json diff --git a/_data/vrms_data.json b/_data/external/vrms_data.json similarity index 100% rename from _data/vrms_data.json rename to _data/external/vrms_data.json diff --git a/_data/wins-data.json b/_data/external/wins-data.json similarity index 100% rename from _data/wins-data.json rename to _data/external/wins-data.json From 35a0aac6b3042a9cc7a26601257839e158ca47f4 Mon Sep 17 00:00:00 2001 From: Akib Mohaimenur Rahman Date: Fri, 19 Mar 2021 16:00:55 -0400 Subject: [PATCH 2/5] changed action code to reflect new path --- .github/workflows/_wins-data.yml | 2 +- github-actions/wins-data/clean-and-save-wins-data.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_wins-data.yml b/.github/workflows/_wins-data.yml index 7e40e1b060..8536a6a7b9 100644 --- a/.github/workflows/_wins-data.yml +++ b/.github/workflows/_wins-data.yml @@ -28,7 +28,7 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v3.0.0 with: # Optional glob pattern of files which should be added to the commit - file_pattern: _data/_wins-data.json + file_pattern: _data/external/_wins-data.json commit_message: Update contributor and language data diff --git a/github-actions/wins-data/clean-and-save-wins-data.js b/github-actions/wins-data/clean-and-save-wins-data.js index 8693fa5e68..d8537a8836 100644 --- a/github-actions/wins-data/clean-and-save-wins-data.js +++ b/github-actions/wins-data/clean-and-save-wins-data.js @@ -2,7 +2,7 @@ const axios = require("axios"); const fs = require("fs"); const core = require("@actions/core"); -const PATH_TO_WRITE_FILE = "_data/_wins-data.json"; +const PATH_TO_WRITE_FILE = "_data/external/_wins-data.json"; const BASE_API_URL = "https://sheets.googleapis.com/v4/spreadsheets"; const SPREAD_SHEET_ID = "1zkr_dEyiT-WTksUkVyL4jYQuYC5_YvJCLrUIfBf1CeE"; From 7e47b1f9225d29011ed8c79f8a147e2d7e845262 Mon Sep 17 00:00:00 2001 From: Akib Mohaimenur Rahman Date: Fri, 19 Mar 2021 16:02:21 -0400 Subject: [PATCH 3/5] add new path to vrms-data.yml --- .github/workflows/vrms-data.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vrms-data.yml b/.github/workflows/vrms-data.yml index c4b2ed9125..b5f4d1ab50 100644 --- a/.github/workflows/vrms-data.yml +++ b/.github/workflows/vrms-data.yml @@ -16,7 +16,7 @@ jobs: # Use an action (`my-action`) in your repository - name: Save vrms_data.json - run: curl -o _data/vrms_data.json https://www.vrms.io/api/recurringevents + run: curl -o _data/external/vrms_data.json https://www.vrms.io/api/recurringevents - uses: stefanzweifel/git-auto-commit-action@v3.0.0 with: From ec9738d8038ab4ba8f4cb36a486b7d9392d8c5f9 Mon Sep 17 00:00:00 2001 From: Akib Mohaimenur Rahman Date: Fri, 19 Mar 2021 16:04:13 -0400 Subject: [PATCH 4/5] Update get-project-data.js to reflect new save and read location --- github-actions/github-data/get-project-data.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github-actions/github-data/get-project-data.js b/github-actions/github-data/get-project-data.js index bb05f0e44c..a1d03aa4c1 100644 --- a/github-actions/github-data/get-project-data.js +++ b/github-actions/github-data/get-project-data.js @@ -67,7 +67,7 @@ const octokit = new Octokit({ auth: core.getInput("token") }); * @return {Object} [Contains old project data as "oldGitHubData" and the date this script last ran as "dateLastRan"] */ function getLocalData(){ - let data = fs.readFileSync('_data/github-data.json', 'utf8'); + let data = fs.readFileSync('_data/external/github-data.json', 'utf8'); data = JSON.parse(data); if(Date.parse(data[0]) > 0){ let date = new Date(data[0]); @@ -186,7 +186,7 @@ function writeData(projectData){ projectData.sort(sortById); // Store the date this script finished running. dateRan is a global variable defined at the beginning of this script projectData.unshift(dateRan.toString()); - fs.writeFileSync('_data/github-data.json', JSON.stringify(projectData, null, 2)); + fs.writeFileSync('_data/external/github-data.json', JSON.stringify(projectData, null, 2)); } /** From 08f022bcef641b3f5ba9057a5e22e7ba39d58c54 Mon Sep 17 00:00:00 2001 From: Akib Mohaimenur Rahman Date: Fri, 19 Mar 2021 16:06:01 -0400 Subject: [PATCH 5/5] update wins-data.yml and vrms-data.yml to reflect new save location --- .github/workflows/vrms-data.yml | 2 +- .github/workflows/wins-data.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/vrms-data.yml b/.github/workflows/vrms-data.yml index b5f4d1ab50..2e19a744b9 100644 --- a/.github/workflows/vrms-data.yml +++ b/.github/workflows/vrms-data.yml @@ -21,7 +21,7 @@ jobs: - uses: stefanzweifel/git-auto-commit-action@v3.0.0 with: # Optional glob pattern of files which should be added to the commit - file_pattern: _data/vrms_data.json + file_pattern: _data/external/vrms_data.json commit_message: Update meeting data diff --git a/.github/workflows/wins-data.yml b/.github/workflows/wins-data.yml index 49a34804a1..6ed91fc46f 100644 --- a/.github/workflows/wins-data.yml +++ b/.github/workflows/wins-data.yml @@ -15,12 +15,12 @@ jobs: - uses: actions/checkout@v2 - name: Save wins-data.json - run: curl -o _data/wins-data.json https://sheets.googleapis.com/v4/spreadsheets/1tj6eQlVLFgmskoXouVt87POxYVwR1yWT2vOSQEPyDtg/values/Responses?key=${{ secrets.WINS_API_KEY }} + run: curl -o _data/external/wins-data.json https://sheets.googleapis.com/v4/spreadsheets/1tj6eQlVLFgmskoXouVt87POxYVwR1yWT2vOSQEPyDtg/values/Responses?key=${{ secrets.WINS_API_KEY }} - uses: stefanzweifel/git-auto-commit-action@v3.0.0 with: # Optional glob pattern of files which should be added to the commit - file_pattern: _data/wins-data.json + file_pattern: _data/external/wins-data.json commit_message: Update wins data