lots0logs / gh-action-get-changed-files

GitHub Action that saves changed files as JSON for use by other actions.
MIT License
88 stars 38 forks source link

Accessing the number of changed/added files #20

Open johentsch opened 3 years ago

johentsch commented 3 years ago

Hi there, thanks for this action, it works really well in our automated workflows!

There is one thing I don't know how to achieve and was wondering if you already know a solution: Most of your workflows act on modified or added files, meaning that they don't actually need to run if there are none (wasting server time and energy with installing libraries for nothing). However, I haven't found a way to test the size of a JSON array to include it in an if: clause. There might be a way to count elements after using join(steps.modified.outputs.modified) but I didn't manage. By any chance, have you or anyone else already encountered this and found a solution?

Otherwise, would it be easy to add another set of properties such as modified_n, added_n etc. to get the numbers? You wouldn't believe how much that would be helpful and appreciated.