hellofresh/action-changed-files

Handle deletion better

gferon opened this issue · 2 comments

If a pull-request contains deletions, the script isn't equipped to not generate a job matrix entry for this match.

The logic might be a bit tricky to implement properly, so we need to be extra careful.

It looks like this is not really possible to correctly implement at this level. Let me try to explain my reasoning:

Consider the following PR:

  • modified: a/staging/new.txt
  • removed: a/staging/old.txt

with pattern a/(?P<environment>b) - it isn't really possible to annotate the matrix entry for environment with anything that makes sense.

It looks like the case where the directory doesn't exist anymore should be handled by pipelines on a case-per-case basis.

The only case we could cover is if all changes matching a pattern are deleted, in which case we can flag the matrix entry with removed: true or something like that.