From afecf975db04c67ec2ce911e3be117fec0316eba Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 23 Nov 2021 22:20:02 -0800 Subject: [PATCH] fixup! tools: ping TSC members identified as inactive --- .github/workflows/find-inactive-tsc.yml | 2 ++ tools/find-inactive-tsc.mjs | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/find-inactive-tsc.yml b/.github/workflows/find-inactive-tsc.yml index ac270ba2b18906..b2dabf8798ab25 100644 --- a/.github/workflows/find-inactive-tsc.yml +++ b/.github/workflows/find-inactive-tsc.yml @@ -45,6 +45,8 @@ jobs: This PR was generated by tools/find-inactive-tsc.yml. @nodejs/tsc ${{ env.INACTIVE_TSC_MEMBERS }} + + ${{ env.DETAILS_FOR_COMMIT_BODY }} commit-message: "meta: move one or more TSC members to emeritus" labels: meta title: "meta: move one or more TSC members to emeritus" diff --git a/tools/find-inactive-tsc.mjs b/tools/find-inactive-tsc.mjs index 6e4482cc2ceec6..98400d77855227 100755 --- a/tools/find-inactive-tsc.mjs +++ b/tools/find-inactive-tsc.mjs @@ -113,10 +113,6 @@ async function getVotingRecords(tscMembers, votes) { votingRecords[member] = 0; } for (const vote of votes) { - // Skip if not a .json file, such as README.md. - if (!vote.endsWith('.json')) { - continue; - } // Get the vote data. const voteData = JSON.parse( await fs.promises.readFile(path.join('.tmp', vote), 'utf8') @@ -240,7 +236,7 @@ const lightAttendance = tscMembers.filter( // Get all votes since SINCE. // Assumes that the TSC repo is cloned in the .tmp dir. const votes = await runGitCommand( - `git whatchanged --since '${SINCE}' --name-only --pretty=format: votes`, + `git whatchanged --since '${SINCE}' --name-only --pretty=format: votes/*.json`, { cwd: '.tmp', mapFn: (line) => line } ); @@ -256,6 +252,14 @@ if (inactive.length) { // The stdout output is consumed in find-inactive-tsc.yml. If format of output // changes, find-inactive-tsc.yml may need to be updated. console.log(`INACTIVE_TSC_HANDLES="${inactive.map((entry) => '@' + entry).join(' ')}"`); + const commitDetails = inactive.map((entry) => { + let details = `Since ${SINCE}, `; + details += `${entry} attended ${attendance[entry]} out of ${meetings.size} meetings`; + details += ` and voted in ${votingRecords[entry]} of ${votes.size} votes.`; + return details; + }); + console.log(`DETAILS_FOR_COMMIT_BODY="${commitDetails.join(' ')}"`); + // Using console.warn() to avoid messing with find-inactive-tsc which consumes // stdout. console.warn('Generating new README.md file...');