From 51aa1fdf421a0dc54bfd10954ec7cb627f1655ca Mon Sep 17 00:00:00 2001 From: Kevin Dice Date: Mon, 27 Sep 2021 15:19:32 -0600 Subject: [PATCH] fix: simplify --- plugin.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugin.js b/plugin.js index c825b46..aac23e9 100644 --- a/plugin.js +++ b/plugin.js @@ -64,17 +64,15 @@ app.post('/', bodyParser.json({limit: '50mb'}), async (req, res) => { const matchedFiles = glob.match(requiredFiles, filesChanged, { dot: true }) console.log('Matched files for step:', matchedFiles.length, 'Allowed matches:', requiredFiles) - if (matchedFiles.length) { - // Allow it through unchanged - return s; - } else { + if (!matchedFiles.length) { // Add an impossible conditional which guarantees the step gets skipped s.when = { ...s.when, event: { exclude: ['*']}, } - return s; } + + return s; }) return transformedSteps.length ? yaml.stringify({ ...py, steps: transformedSteps }) : nullYaml(index)