| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d948148 commit cec0482
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,18 +7,24 @@ on: | |||
| 7 | 7 | ||
| 8 | 8 | workflow_dispatch: | |
| 9 | 9 | ||
| 10 | + env: | ||
| 11 | + NODE_VERSION: 16.x | ||
| 12 | + NUM_COMMITS: 5000 | ||
| 13 | + | ||
| 10 | 14 | jobs: | |
| 11 | 15 | find: | |
| 12 | 16 | ||
| 13 | 17 | runs-on: ubuntu-latest | |
| 14 | 18 | ||
| 15 | 19 | steps: | |
| 16 | 20 | - uses: actions/checkout@v2 | |
| 17 | - | ||
| 18 | - - name: Install Node.js | ||
| 21 | + with: | ||
| 22 | + fetch-depth: ${{ env.NUM_COMMITS }} | ||
| 23 | + | ||
| 24 | + - name: Use Node.js ${{ env.NODE_VERSION }} | ||
| 19 | 25 | uses: actions/setup-node@v2 | |
| 20 | 26 | with: | |
| 21 | - node-version: 16.x | ||
| 27 | + node-version: ${{ env.NODE_VERSION }} | ||
| 22 | 28 | ||
| 23 | 29 | - name: Find inactive collaborators | |
| 24 | - run: tools/find-inactive-collaborators.mjs '1 year ago' | ||
| 30 | + run: tools/find-inactive-collaborators.mjs ${{ env.NUM_COMMITS }} | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ import cp from 'node:child_process'; | |||
| 8 | 8 | import fs from 'node:fs'; | |
| 9 | 9 | import readline from 'node:readline'; | |
| 10 | 10 | ||
| 11 | - const SINCE = process.argv[2] || '6 months ago'; | ||
| 11 | + const SINCE = +process.argv[2] || 5000; | ||
| 12 | 12 | ||
| 13 | 13 | async function runGitCommand(cmd, mapFn) { | |
| 14 | 14 | const childProcess = cp.spawn('/bin/sh', ['-c', cmd], { | |
@@ -36,19 +36,19 @@ async function runGitCommand(cmd, mapFn) { | |||
| 36 | 36 | ||
| 37 | 37 | // Get all commit authors during the time period. | |
| 38 | 38 | const authors = await runGitCommand( | |
| 39 | - `git shortlog -n -s --since="${SINCE}"`, | ||
| 39 | + `git shortlog -n -s --max-count="${SINCE}" HEAD`, | ||
| 40 | 40 | (line) => line.trim().split('\t', 2)[1] | |
| 41 | 41 | ); | |
| 42 | 42 | ||
| 43 | 43 | // Get all commit landers during the time period. | |
| 44 | 44 | const landers = await runGitCommand( | |
| 45 | - `git shortlog -n -s -c --since="${SINCE}"`, | ||
| 45 | + `git shortlog -n -s -c --max-count="${SINCE}" HEAD`, | ||
| 46 | 46 | (line) => line.trim().split('\t', 2)[1] | |
| 47 | 47 | ); | |
| 48 | 48 | ||
| 49 | 49 | // Get all approving reviewers of landed commits during the time period. | |
| 50 | 50 | const approvingReviewers = await runGitCommand( | |
| 51 | - `git log --since="${SINCE}" | egrep "^ Reviewed-By: "`, | ||
| 51 | + `git log --max-count="${SINCE}" | egrep "^ Reviewed-By: "`, | ||
| 52 | 52 | (line) => /^ Reviewed-By: ([^<]+)/.exec(line)[1].trim() | |
| 53 | 53 | ); | |
| 54 | 54 | ||
@@ -78,10 +78,11 @@ async function retrieveCollaboratorsFromReadme() { | |||
| 78 | 78 | // Get list of current collaborators from README.md. | |
| 79 | 79 | const collaborators = await retrieveCollaboratorsFromReadme(); | |
| 80 | 80 | ||
| 81 | - console.log(`${authors.size.toLocaleString()} authors have made commits since ${SINCE}.`); | ||
| 82 | - console.log(`${landers.size.toLocaleString()} landers have landed commits since ${SINCE}.`); | ||
| 83 | - console.log(`${approvingReviewers.size.toLocaleString()} reviewers have approved landed commits since ${SINCE}.`); | ||
| 84 | - console.log(`${collaborators.length.toLocaleString()} collaborators currently in the project.`); | ||
| 81 | + console.log(`In the last ${SINCE} commits:\n`); | ||
| 82 | + console.log(`* ${authors.size.toLocaleString()} authors have made commits.`); | ||
| 83 | + console.log(`* ${landers.size.toLocaleString()} landers have landed commits.`); | ||
| 84 | + console.log(`* ${approvingReviewers.size.toLocaleString()} reviewers have approved landed commits.`); | ||
| 85 | + console.log(`* ${collaborators.length.toLocaleString()} collaborators currently in the project.`); | ||
| 85 | 86 | ||
| 86 | 87 | const inactive = collaborators.filter((collaborator) => | |
| 87 | 88 | !authors.has(collaborator) && | |
@@ -90,6 +91,6 @@ const inactive = collaborators.filter((collaborator) => | |||
| 90 | 91 | ); | |
| 91 | 92 | ||
| 92 | 93 | if (inactive.length) { | |
| 93 | - console.log('\nInactive collaborators:'); | ||
| 94 | - console.log(inactive.join('\n')); | ||
| 94 | + console.log('\nInactive collaborators:\n'); | ||
| 95 | + console.log(inactive.map((name) => `* ${name}`).join('\n')); | ||
| 95 | 96 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments