I’m trying to figure out a way to conditionally run step release-run-slack-notification if the step before it, create-slack-templatefails.
The step create-slack-template checks if the drone build has a certain tag or not as an environmental variable. If it contains a tag, it runs the next step and send the slack message. If not, it shouldn’t send a slack message.
Currently, regardless of whether the drone build has a certain tag or not, the release-run-slack-notification steps still runs. I’m somewhat getting around this by creating a line in the release-slack.txt to show IGNORE if this tag is present. However, this creates a lot of unneeded notifications in slack with the IGNORE flag
I think you might be mixing conditions at the stage level and pipeline level that could be the problem.
You have this at the pipeline stage level:
The “custom” event would be for a manual promotion of a build, is that what you are doing? Also, this entire pipleline stage would only run if previous pipeline stages failed (since you have set “failure” status), is that the behavior you want?
From what you are describing, I think you should remove the depends_on for create-slack-template and release-run-slack-notification, and add a “when” condition for failure.