const cp = require('child_process'); const main = () => { const res = cp.execSync('git status --porcelain plugins') + ''; // M plugins/cnbcool/annotations/plugin-meta.json -> cnbcool/annotations const files = res.split('\n').filter(Boolean).filter(item => !item.endsWith('plugins.json')).map(item => item.replace(/\s+M\s+/, '')).map(item => item.split('/').slice(1, -1).join('/')); console.log(files, res) const diffPlugins = [...new Set(files)]; console.log('diffPlugins', diffPlugins); console.log(`##[set-output plugins=${escape(diffPlugins.join(';'))}]`); }; main();