Is it possible to pass a build even if a step/stage fails

There is a step in my travis build where I trigger a command to run sonarqube analysis on the code change from the PR. The step is added as an after_success block.

  - if [ "$TRAVIS_PULL_REQUEST_BRANCH" != "" ]; then make sonar-check-pr; fi
  - if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then make sonar-check-baseline; fi

Is it possible to pass the build regardless of the outcome of this step? Right now if the make command fails, it fails the travis build due to which the PR gets blocked and no one can merge it.

Hey @abhivaikar,

I’m not quite sure why you’d want to pass the build regardless of the outcome but a couple of things come to mind.

In my opinion it’s either shippable (pass) or not (fail). It’s fairly deliberate as to why there’s no grey zone. I’m pretty sure with my expertise, it’s not possible “from a single pipeline”. You can however do things like:

install: skip
script: skip
1 Like