Skip to content

Commit 08d864f

Browse files
committed
Implemented default:before_script and default:after_script
1 parent 73e518e commit 08d864f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/job.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ export class Job {
3030
this.stage = jobData.stage || ".pre";
3131
this.scripts = [].concat(jobData.script || []);
3232

33-
this.beforeScripts = [].concat(jobData.before_script || globals.before_script || []);
34-
this.afterScripts = [].concat(jobData.after_script || globals.after_script || []);
33+
const ciDefault = globals.default || {};
34+
this.beforeScripts = [].concat(jobData.before_script || ciDefault.before_script || globals.before_script || []);
35+
this.afterScripts = [].concat(jobData.after_script || ciDefault.after_script || globals.after_script || []);
3536
this.allowFailure = jobData.allow_failure || false;
3637
this.variables = jobData.variables || {};
3738
}

0 commit comments

Comments
 (0)