Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tools: use GITHUB_ACTIONS env var in inactivity scripts
Don't rewrite the README if we're not running inside a GitHub Action.
  • Loading branch information
Trott committed Jan 7, 2022
commit 5ea7814128758d4312967a88ed5a4bff0354b1f8
9 changes: 5 additions & 4 deletions tools/find-inactive-collaborators.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ const inactive = collaborators.filter((collaborator) =>
if (inactive.length) {
console.log('\nInactive collaborators:\n');
console.log(inactive.map((entry) => `* ${entry.name}`).join('\n'));
console.log('\nGenerating new README.md file...');
const newReadmeText = await moveCollaboratorToEmeritus(inactive);
fs.writeFileSync(new URL('../README.md', import.meta.url), newReadmeText);
console.log('Updated README.md generated. Please commit these changes.');
if (process.env.GITHUB_ACTIONS) {
console.log('\nGenerating new README.md file...');
const newReadmeText = await moveCollaboratorToEmeritus(inactive);
fs.writeFileSync(new URL('../README.md', import.meta.url), newReadmeText);
}
}
13 changes: 7 additions & 6 deletions tools/find-inactive-tsc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,11 @@ if (inactive.length) {
});
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...');
const newReadmeText = await moveTscToEmeritus(inactive);
fs.writeFileSync(new URL('../README.md', import.meta.url), newReadmeText);
console.warn('Updated README.md generated. Please commit these changes.');
if (process.env.GITHUB_ACTIONS) {
// 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);
}
}