[RESOLVED] Build.pull_request.draft conditional IF is not working

Context:

I have a pipeline which hook to my private GitHub repo:

steps:
  - label: "Compile app"
    if: !build.pull_request.draft
    commands: "make -j128"

Expected:

Trigger new build for only non-draft GitHub PR

Actual

Trigger new build for draft and non-draft Github PR

It turns out it is totally my fault.

@sj26 has helped me resolve this issue by suggesting wrapping the if value in double-quotes, that is:

steps:
  - label: "Compile app"
    if: "!build.pull_request.draft"
    commands: "make -j128"
1 Like