| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3c8aa21 commit 0201f3f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,7 @@ jobs: | |||
| 32 | 32 | node-version: ${{ env.NODE_VERSION }} | |
| 33 | 33 | ||
| 34 | 34 | - name: Find inactive TSC members | |
| 35 | - run: tools/find-inactive-tsc.mjs | ||
| 35 | + run: tools/find-inactive-tsc.mjs >> $GITHUB_ENV | ||
| 36 | 36 | ||
| 37 | 37 | - name: Open pull request | |
| 38 | 38 | uses: gr2m/create-or-update-pull-request-action@v1 | |
@@ -41,7 +41,12 @@ jobs: | |||
| 41 | 41 | with: | |
| 42 | 42 | author: Node.js GitHub Bot <github-bot@iojs.org> | |
| 43 | 43 | 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 | + @nodejs/tsc ${{ env.INACTIVE_TSC_HANDLES }} | ||
| 48 | + | ||
| 49 | + ${{ env.DETAILS_FOR_COMMIT_BODY }} | ||
| 45 | 50 | commit-message: "meta: move one or more TSC members to emeritus" | |
| 46 | 51 | labels: meta | |
| 47 | 52 | title: "meta: move one or more TSC members to emeritus" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -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 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments