Skip to content

Commit 931118d

Browse files
committed
If rules are specified when: never is default
1 parent 6f61f39 commit 931118d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/job.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,14 @@ export class Job {
125125
}
126126

127127
public async initRules() {
128-
for (const rule of this.rules || []) {
128+
if (!this.rules) {
129+
return;
130+
}
131+
132+
this.when = 'never';
133+
this.allowFailure = false;
134+
135+
for (const rule of this.rules) {
129136
try {
130137
if (rule['if']) {
131138
const output = childProcess.execSync(`[ ${rule['if']} ] && exit 0 || exit 1`, {cwd: this.cwd, env: this.getEnvs(), shell: 'bash'});

0 commit comments

Comments
 (0)