I am using drone CI with the docker plugin and I would like to create an image tag using the commit, the branch name and the tag if any of those exist in the event that triggered the pipeline. How would I do that?
I've tried using defaults to avoid the build crashing because "foo/bar:" isn't a valid tag but this is not an ideal solution and for the branch name I need to replace a part of the string and I cant find a way to do both.
So, how would you apply a tag only if the env variable exists?