mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Automation: Add support for *.rituals.yml (#13754)
Co-authored-by: Mike McNeil <mikermcneil@users.noreply.github.com>
This commit is contained in:
parent
740014fcc7
commit
7481cec68f
3 changed files with 13 additions and 7 deletions
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue