Automation: Add support for *.rituals.yml (#13754)

Co-authored-by: Mike McNeil <mikermcneil@users.noreply.github.com>
This commit is contained in:
Sampfluger88 2023-09-06 23:20:13 -05:00 committed by GitHub
parent 740014fcc7
commit 7481cec68f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View file

@ -310,8 +310,7 @@ When processing new requests from this channel, consider this:
- 12:30 PM /beginning of "reserved block"
- 6:30 PM /post-mortem days meetings
<rituals :rituals="rituals['handbook/company/ceo-rituals.yml']"></rituals>
<rituals :rituals="rituals['handbook/company/ceo.rituals.yml']"></rituals>
<meta name="maintainedBy" value="Sampfluger88">

View file

@ -22,13 +22,20 @@ module.exports = {
'Authorization': `token ${sails.config.custom.githubAccessToken}`
};
let ritualSources = [
{ path: 'handbook/company/rituals.yml', },
];
for (let ritualSource of ritualSources) {
// Find all the files in the top level /handbook folder and it's sub-folders
let FILES_IN_HANDBOOK_FOLDER = await sails.helpers.fs.ls.with({
dir: path.join(topLvlRepoPath, '/handbook'),
depth: 3
});
// Filter the list of filenames to get the rituals YAML files.
let ritualYamlPaths = FILES_IN_HANDBOOK_FOLDER.filter((filePath)=>{
return _.endsWith(filePath, 'rituals.yml');
});
for (let ritualSource of ritualYamlPaths) {
// Load rituals
let pathToRituals = path.resolve(topLvlRepoPath, ritualSource.path);
let pathToRituals = path.resolve(topLvlRepoPath, ritualSource);
let rituals = [];
let ritualsYml = await sails.helpers.fs.read(pathToRituals);
try {