Skip to content

Commit

Permalink
fixup! tools: ping TSC members identified as inactive
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Nov 24, 2021
1 parent b5cebc7 commit 344c45d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/find-inactive-tsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
14 changes: 9 additions & 5 deletions tools/find-inactive-tsc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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 }
);

Expand All @@ -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...');
Expand Down

0 comments on commit 344c45d

Please sign in to comment.