Condition: on changes to paths

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.

Check out https://github.com/meltwater/drone-convert-pathschanged and 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.

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.