Environment variables as conditions

Is it possible to use environment variables as conditions? We need to avoid builds if certain files are not modified. From the discussion here, it seems to be impossible, but I’m being positive :slight_smile:. GH actions supports this beautifully with if: ENV_VAR == "true" .

This is how we solved it:

      # skip this job
      - if [ -z $PMBOT ]; then exit 0; fi

The job will still be run by Drone, but you can exit early. It’s does not affect performance much as Drone shares the build workspace between jobs.

1 Like

That’s a pretty simple solution indeed; thanks!
Nevertheless, a native integration would’ve been great.

Agreed :slight_smile: