Skip to content

foxfirecodes/yamore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yamore

npm version

A simple preprocessor that adds more functionality to YAML in the form of preprocessing.

usage

// .github/process.js
import fs from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { transformFile } from 'yamore'

const baseDir = path.dirname(fileURLToPath(import.meta.url))
const templatesDir = path.join(baseDir, 'workflow-templates')
const outDir = path.join(baseDir, 'workflows')

for (const template of await fs.readdir(templatesDir)) {
  if (!template.endsWith('.yml')) continue
  console.log(`🤔 processing ${template}...`)
  transformFile(path.join(templatesDir, template), path.join(outDir, template))
  console.log(`✅ processed ${template}!`)
}

About

A simple preprocessor that adds more functionality to YAML in the form of preprocessing.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors