Skip to content

Commit 612ad2a

Browse files
authoredMar 21, 2025··
Merge branch 'master' into another-scm-admins
2 parents 4eb5238 + aa751b8 commit 612ad2a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
 

‎plugins/webhooks/helper.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ function hasChangesUnderRootDir(pipeline, changedFiles) {
229229

230230
// Only check if rootDir is set
231231
if (rootDir) {
232-
return changes.some(file => file.startsWith(rootDir));
232+
return changes.some(file => file.startsWith(`${rootDir}/`));
233233
}
234234

235235
return true;

‎test/plugins/webhooks.helper.test.js

+10
Original file line numberDiff line numberDiff line change
@@ -1382,6 +1382,16 @@ describe('startHookEvent test', () => {
13821382
});
13831383
});
13841384

1385+
it('returns 204 no event creation on success for pipelines with rootDir', () => {
1386+
pipelineMock.scmUri = `${pipelineMock.scmUri}:lib`;
1387+
pipelineFactoryMock.scm.getChangedFiles.resolves(['library']);
1388+
1389+
return startHookEvent(request, responseHandler, parsed).then(reply => {
1390+
assert.equal(reply.statusCode, 204);
1391+
assert.notCalled(eventFactoryMock.create);
1392+
});
1393+
});
1394+
13851395
it('returns 201 on success for pipelines when mixed forward matching branch', () => {
13861396
const pMock = getPipelineMocks({
13871397
id: 'pipelineHash1',

0 commit comments

Comments
 (0)
Please sign in to comment.