add stats on activity in last 24 hours
This commit is contained in:
parent
dc2b5e3aa8
commit
2584247a03
2 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
Date,Commits (24hr),Issues (24hr),Issues:BUG (24hr),Issues:RFC (24hr),Issues:DOC (24hr),PRs (24hr),Open PRs,Open Issues,Bugs: Needs Triage,Bugs: Accepted,RFC: Needs Discussion,RFC: In Progress,RFC: Accepted,Date (ISO)
|
||||
"Wednesday, September 1, 2021",22,4,3,1,0,8,7,173,3,54,36,0,12,"2021-09-02T00:09:53.430Z"
|
||||
"Wednesday, September 1, 2021",23,3,2,1,0,0,7,173,3,54,36,0,12,"2021-09-02T00:11:04.598Z"
|
||||
"Wednesday, September 1, 2021",23,4,3,1,0,8,7,173,3,54,36,0,12,"2021-09-02T00:11:31.915Z"
|
||||
|
|
|
Loading…
Reference in a new issue