# Condition: on changes to paths

**URL:** https://drone.discourse.group/t/condition-on-changes-to-paths/10617
**Category:** Drone Support
**Created:** [February 19, 2021, 6:35pm UTC](https://drone.discourse.group/t/condition-on-changes-to-paths/10617 "2021-02-19T18:35:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![awalkerca](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/awalkerca/32/2960_2.png) [@awalkerca](https://drone.discourse.group/u/awalkerca)
#### Post date: [February 19, 2021, 6:35pm UTC](https://drone.discourse.group/t/condition-on-changes-to-paths/10617/1 "2021-02-19T18:35:11Z")

</div>

It would be a huge time saver to only execute steps when code has changed. In a monorepo, there may be several projects (different micro services, client bundles, packages to externally publish, documentation to deploy), but it may only be necessary to perform those steps if there is actually any changes to the code.

Github actions supports this via:

```
on:
  push:
    paths:
    - '**.js'

```

Potential syntax:

```
 - name: build-client
   image: node
   when:
     paths:
       - /client/**
       - /commont/components/**

```

In the monorepo example, it would be nice if anything that was setup to `depends_on: build-client` would also not run, although adding the condition to all the related steps would not be the end of the world.

---

<div class="post-metadata">

### Author: ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)
#### Post date: [February 19, 2021, 8:06pm UTC](https://drone.discourse.group/t/condition-on-changes-to-paths/10617/2 "2021-02-19T20:06:26Z")

</div>

Check out [https://github.com/meltwater/drone-convert-pathschanged](https://github.com/meltwater/drone-convert-pathschanged) and [https://github.com/bitsbeats/drone-tree-config](https://github.com/bitsbeats/drone-tree-config). The former is almost exactly what you described. The latter is a slightly different take on solving a similar problem.

---

<div class="post-metadata">

### Author: ![awalkerca](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/awalkerca/32/2960_2.png) [@awalkerca](https://drone.discourse.group/u/awalkerca)
#### Post date: [February 19, 2021, 8:35pm UTC](https://drone.discourse.group/t/condition-on-changes-to-paths/10617/3 "2021-02-19T20:35:41Z")

</div>

Thanks for sharing, I’ll dive into conversations and see if I can make them work for me.

Looks like it won’t work for me (gitea) but it’s nice to know it’s there. Thanks.
