summaryrefslogtreecommitdiff
path: root/scripts/stats/index.js
diff options
context:
space:
mode:
authorGravatar Fred K. Schott <fkschott@gmail.com> 2021-09-01 17:12:41 -0700
committerGravatar Fred K. Schott <fkschott@gmail.com> 2021-09-01 17:12:41 -0700
commit2584247a0379e91ae83db6bc87cd1e99442bb538 (patch)
tree38908361f4bdc49f2526e52df1cd562a4e096958 /scripts/stats/index.js
parentdc2b5e3aa8d6eb8ca66dbb37d1eafae3e3ac04ce (diff)
downloadastro-2584247a0379e91ae83db6bc87cd1e99442bb538.tar.gz
astro-2584247a0379e91ae83db6bc87cd1e99442bb538.tar.zst
astro-2584247a0379e91ae83db6bc87cd1e99442bb538.zip
add stats on activity in last 24 hours
Diffstat (limited to 'scripts/stats/index.js')
-rw-r--r--scripts/stats/index.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/scripts/stats/index.js b/scripts/stats/index.js
index d1589d4a2..e9ccbb939 100644
--- a/scripts/stats/index.js
+++ b/scripts/stats/index.js
@@ -65,12 +65,12 @@ export async function run() {
const twentyFourHoursAgo = new Date();
twentyFourHoursAgo.setDate(twentyFourHoursAgo.getDate() - 1);
- const allIssues = await octokit.paginate('GET /repos/{owner}/{repo}/issues', {
+ const allOpenIssues = await octokit.paginate('GET /repos/{owner}/{repo}/issues', {
owner,
repo,
});
- const issues = allIssues.filter((iss) => !iss.pull_request);
- const pulls = allIssues.filter((iss) => iss.pull_request);
+ const openIssues = allOpenIssues.filter((iss) => !iss.pull_request);
+ const openPulls = allOpenIssues.filter((iss) => iss.pull_request);
const allIssuesLastTwentyFourHours = await octokit.paginate('GET /repos/{owner}/{repo}/issues', {
owner,
@@ -82,7 +82,6 @@ export async function run() {
const issuesLastTwentyFourHours = allIssuesLastTwentyFourHours.filter((iss) => new Date(iss.created_at) > twentyFourHoursAgo && !iss.pull_request);
const pullsLastTwentyFourHours = allIssuesLastTwentyFourHours.filter((iss) => new Date(iss.created_at) > twentyFourHoursAgo && iss.pull_request);
- console.log(issuesLastTwentyFourHours, pullsLastTwentyFourHours);
const entry = [
// Date (Human Readable)
`"${new Date().toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' })}"`,
@@ -99,9 +98,9 @@ export async function run() {
// New Pull Requests in last 24 hours
pullsLastTwentyFourHours.length,
// Pull requests
- pulls.length,
+ openPulls.length,
// Open Issues
- issues.length,
+ openIssues.length,
// Bugs: Needs Triage
(await countCards(COLUMN_ID_BUGS_NEEDS_TRIAGE)).length,
// Bugs: Accepted