Skip to content

Commit 51aa1fd

Browse files
committed
fix: simplify
1 parent d2c1c4c commit 51aa1fd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

plugin.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,15 @@ app.post('/', bodyParser.json({limit: '50mb'}), async (req, res) => {
6464
const matchedFiles = glob.match(requiredFiles, filesChanged, { dot: true })
6565
console.log('Matched files for step:', matchedFiles.length, 'Allowed matches:', requiredFiles)
6666

67-
if (matchedFiles.length) {
68-
// Allow it through unchanged
69-
return s;
70-
} else {
67+
if (!matchedFiles.length) {
7168
// Add an impossible conditional which guarantees the step gets skipped
7269
s.when = {
7370
...s.when,
7471
event: { exclude: ['*']},
7572
}
76-
return s;
7773
}
74+
75+
return s;
7876
})
7977

8078
return transformedSteps.length ? yaml.stringify({ ...py, steps: transformedSteps }) : nullYaml(index)

0 commit comments

Comments
 (0)