Files
DefiLlama-Adapters/.github/workflows/getFileList.js
2023-07-05 13:29:31 +01:00

16 lines
490 B
JavaScript

const MODIFIED = parse(process.env.MODIFIED)
const ADDED = parse(process.env.ADDED)
const fileSet = new Set();
[...MODIFIED, ...ADDED].forEach(file => {
const [root, dir] = file.split('/')
if (dir === 'treasury' || dir === 'entities') fileSet.add(file)
else if (root === 'projects' && dir !=='helper' && dir !== 'config') fileSet.add(root + '/' + dir)
})
console.log(JSON.stringify([...fileSet]))
function parse(data) {
return data.replace('[', '').replace(']', '').split(',')
}