Skip to content

Commit 05c23cc

Browse files
committed
Fixed bug where extends gets merged with other extends, leading to unwanted behavior
1 parent e8535eb commit 05c23cc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/job.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class Job {
4141
// Parse extends
4242
if (jobData.extends) {
4343
const extendList = [].concat(jobData.extends);
44-
const deepExtendList: any[] = [];
44+
const deepExtendList: any[] = [{}];
4545
extendList.forEach((parentJobName) => {
4646
if (!globals[parentJobName]) {
4747
console.error(`${c.red(`'${parentJobName}' could not be found`)}`);

src/parser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export class Parser {
4848
orderedVariables.push(orderedYml.last().variables || {});
4949

5050
// Parse yamls included by other ci files.
51+
orderedYml.unshift({});
5152
const includes = deepExtend.apply(this, orderedYml).include || [];
5253
for (const value of includes) {
5354
if (!value.local) {
@@ -59,6 +60,7 @@ export class Parser {
5960
}
6061

6162
// Setup variables and "merged" yml
63+
orderedYml.unshift({});
6264
const gitlabData = deepExtend.apply(this, orderedYml);
6365

6466
// Generate stages

0 commit comments

Comments
 (0)