@@ -96,6 +96,8 @@ async function getAttendance(tscMembers, meetings) {
96
96
if ( match ) {
97
97
return match [ 1 ] ;
98
98
}
99
+ // Using `console.warn` so that stdout output is not generated.
100
+ // The stdout output is consumed in find-inactive-tsc.yml.
99
101
console . warn ( `Attendee entry does not contain GitHub handle: ${ line } ` ) ;
100
102
return '' ;
101
103
} )
@@ -111,10 +113,6 @@ async function getVotingRecords(tscMembers, votes) {
111
113
votingRecords [ member ] = 0 ;
112
114
}
113
115
for ( const vote of votes ) {
114
- // Skip if not a .json file, such as README.md.
115
- if ( ! vote . endsWith ( '.json' ) ) {
116
- continue ;
117
- }
118
116
// Get the vote data.
119
117
const voteData = JSON . parse (
120
118
await fs . promises . readFile ( path . join ( '.tmp' , vote ) , 'utf8' )
@@ -238,7 +236,7 @@ const lightAttendance = tscMembers.filter(
238
236
// Get all votes since SINCE.
239
237
// Assumes that the TSC repo is cloned in the .tmp dir.
240
238
const votes = await runGitCommand (
241
- `git whatchanged --since '${ SINCE } ' --name-only --pretty=format: votes` ,
239
+ `git whatchanged --since '${ SINCE } ' --name-only --pretty=format: votes/*.json ` ,
242
240
{ cwd : '.tmp' , mapFn : ( line ) => line }
243
241
) ;
244
242
@@ -251,10 +249,21 @@ const noVotes = tscMembers.filter(
251
249
const inactive = lightAttendance . filter ( ( member ) => noVotes . includes ( member ) ) ;
252
250
253
251
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...' ) ;
252
+ // The stdout output is consumed in find-inactive-tsc.yml. If format of output
253
+ // changes, find-inactive-tsc.yml may need to be updated.
254
+ console . log ( `INACTIVE_TSC_HANDLES="${ inactive . map ( ( entry ) => '@' + entry ) . join ( ' ' ) } "` ) ;
255
+ const commitDetails = inactive . map ( ( entry ) => {
256
+ let details = `Since ${ SINCE } , ` ;
257
+ details += `${ entry } attended ${ attendance [ entry ] } out of ${ meetings . size } meetings` ;
258
+ details += ` and voted in ${ votingRecords [ entry ] } of ${ votes . size } votes.` ;
259
+ return details ;
260
+ } ) ;
261
+ console . log ( `DETAILS_FOR_COMMIT_BODY="${ commitDetails . join ( ' ' ) } "` ) ;
262
+
263
+ // Using console.warn() to avoid messing with find-inactive-tsc which consumes
264
+ // stdout.
265
+ console . warn ( 'Generating new README.md file...' ) ;
257
266
const newReadmeText = await moveTscToEmeritus ( inactive ) ;
258
267
fs . writeFileSync ( new URL ( '../README.md' , import . meta. url ) , newReadmeText ) ;
259
- console . log ( 'Updated README.md generated. Please commit these changes.' ) ;
268
+ console . warn ( 'Updated README.md generated. Please commit these changes.' ) ;
260
269
}
0 commit comments