Skip to content

Commit

Permalink
tools: ping TSC members identified as inactive
Browse files Browse the repository at this point in the history
When detecting TSC members as inactive, @-mention them in the pull
request that moves them to emeritus. This notifies them in case the pull
request is in error.
  • Loading branch information
Trott committed Nov 21, 2021
1 parent c6352f5 commit d546290
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/find-inactive-tsc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
node-version: ${{ env.NODE_VERSION }}

- name: Find inactive TSC members
run: tools/find-inactive-tsc.mjs
run: tools/find-inactive-tsc.mjs >> $GITHUB_ENV

- name: Open pull request
uses: gr2m/create-or-update-pull-request-action@v1
Expand All @@ -41,7 +41,10 @@ jobs:
with:
author: Node.js GitHub Bot <github-bot@iojs.org>
branch: actions/inactive-tsc
body: This PR was generated by tools/find-inactive-tsc.yml.
body: |
This PR was generated by tools/find-inactive-tsc.yml.
In case there was an error: ${{ env.INACTIVE_TSC_MEMBERS }}
commit-message: "meta: move one or more TSC members to emeritus"
labels: meta
title: "meta: move one or more TSC members to emeritus"
13 changes: 9 additions & 4 deletions tools/find-inactive-tsc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ async function getAttendance(tscMembers, meetings) {
if (match) {
return match[1];
}
// Using `console.warn` so that stdout output is not generated.
// The stdout output is consumed in find-inactive-tsc.yml.
console.warn(`Attendee entry does not contain GitHub handle: ${line}`);
return '';
})
Expand Down Expand Up @@ -251,10 +253,13 @@ const noVotes = tscMembers.filter(
const inactive = lightAttendance.filter((member) => noVotes.includes(member));

if (inactive.length) {
console.log('\nInactive TSC members:\n');
console.log(inactive.map((entry) => `* ${entry}`).join('\n'));
console.log('\nGenerating new README.md file...');
// 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(' ')}"`);
// Using console.warn() to avoid messing with find-inactive-tsc which consumes
// stdout.
console.warn('Generating new README.md file...');
const newReadmeText = await moveTscToEmeritus(inactive);
fs.writeFileSync(new URL('../README.md', import.meta.url), newReadmeText);
console.log('Updated README.md generated. Please commit these changes.');
console.warn('Updated README.md generated. Please commit these changes.');
}

0 comments on commit d546290

Please sign in to comment.