# How to make a conditions based on a previous step output

**URL:** <https://drone.discourse.group/t/how-to-make-a-conditions-based-on-a-previous-step-output/8191>\
**Category:** Drone Support\
**Created:** [January 12, 2022, 7:59pm UTC](https://drone.discourse.group/t/how-to-make-a-conditions-based-on-a-previous-step-output/8191 "2022-01-12T19:59:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oly](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/oly/32/6620_2.png) [@oly](https://drone.discourse.group/u/oly)\
**Post date:** [January 12, 2022, 7:59pm UTC](https://drone.discourse.group/t/how-to-make-a-conditions-based-on-a-previous-step-output/8191/1 "2022-01-12T19:59:48Z")

</div>

Is there a way I can reproduce this in drone, so in these steps below I am running a cmd line tool which can detect which projects have changed in a repo, the repo has components and builds up projects from the components, I then want to deploy any of the projects have that have changed so I need to check if the project exists in the lists from the cmd line tool.

Is this possible ?

```auto

      - name: Set Env
        run: |-
          cd workspace
          echo "CHANGED_PROJECTS=$(clojure -M:poly ws get:changes:changed-or-affected-projects since:previous-release skip:dev)" >> $GITHUB_ENV

```

```auto

      - name: Build api
        if: contains('${{ env.CHANGED_PROJECTS }}', 'example-api')
        run: |-
          cd workspace/projects/example-api
          clojure -X:uberjar

```
