microadam / drone-config-changeset-conditional

The Unlicense
65 stars 16 forks source link

throw error if no pipeline #17

Open jimsheldon opened 4 years ago

jimsheldon commented 4 years ago

This should fix #14

microadam commented 4 years ago

Hi @jimsheldon. Thanks for the contribution. I am not sure this will work though, as this seems to assume that there will only be ONE yaml doc in the drone file. There could be multiple pipelines or even things like:

---
kind: secret

This PR assumes that it will only contain ONE yaml doc, so if you used a secret doc, it would break as you are throwing within a map function

jimsheldon commented 4 years ago

Thanks @microadam we will look into this

jimsheldon commented 4 years ago

@microadam I pushed a fix that should handle non-pipeline kinds properly

microadam commented 4 years ago

Thanks for this! I will try and have a proper look through this soon. I really need to get some unit tests on this project so we can ensure no existing functionality breaks with little changes like this.