Skip to content

Commit d546290

Browse files
committed
tools: ping TSC members identified as inactive
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.
1 parent c6352f5 commit d546290

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.github/workflows/find-inactive-tsc.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
node-version: ${{ env.NODE_VERSION }}
3333

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

3737
- name: Open pull request
3838
uses: gr2m/create-or-update-pull-request-action@v1
@@ -41,7 +41,10 @@ jobs:
4141
with:
4242
author: Node.js GitHub Bot <github-bot@iojs.org>
4343
branch: actions/inactive-tsc
44-
body: This PR was generated by tools/find-inactive-tsc.yml.
44+
body: |
45+
This PR was generated by tools/find-inactive-tsc.yml.
46+
47+
In case there was an error: ${{ env.INACTIVE_TSC_MEMBERS }}
4548
commit-message: "meta: move one or more TSC members to emeritus"
4649
labels: meta
4750
title: "meta: move one or more TSC members to emeritus"

tools/find-inactive-tsc.mjs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ async function getAttendance(tscMembers, meetings) {
9696
if (match) {
9797
return match[1];
9898
}
99+
// Using `console.warn` so that stdout output is not generated.
100+
// The stdout output is consumed in find-inactive-tsc.yml.
99101
console.warn(`Attendee entry does not contain GitHub handle: ${line}`);
100102
return '';
101103
})
@@ -251,10 +253,13 @@ const noVotes = tscMembers.filter(
251253
const inactive = lightAttendance.filter((member) => noVotes.includes(member));
252254

253255
if (inactive.length) {
254-
console.log('\nInactive TSC members:\n');
255-
console.log(inactive.map((entry) => `* ${entry}`).join('\n'));
256-
console.log('\nGenerating new README.md file...');
256+
// The stdout output is consumed in find-inactive-tsc.yml. If format of output
257+
// changes, find-inactive-tsc.yml may need to be updated.
258+
console.log(`INACTIVE_TSC_HANDLES="${inactive.map((entry) => '@' + entry).join(' ')}"`);
259+
// Using console.warn() to avoid messing with find-inactive-tsc which consumes
260+
// stdout.
261+
console.warn('Generating new README.md file...');
257262
const newReadmeText = await moveTscToEmeritus(inactive);
258263
fs.writeFileSync(new URL('../README.md', import.meta.url), newReadmeText);
259-
console.log('Updated README.md generated. Please commit these changes.');
264+
console.warn('Updated README.md generated. Please commit these changes.');
260265
}

0 commit comments

Comments
 (0)