Skip to content

Commit

Permalink
fix: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
kdnutrien committed Sep 27, 2021
1 parent d2c1c4c commit 51aa1fd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 51aa1fd

Please sign in to comment.