I'm looking for a feature in Buildkite, similar to Gitlab's rules: change:, where a pipeline step is only executed if a specific file has been changed in the commit.
Something like this would be ideal, but doesn't seem to be available:
steps:
command: "package_dependencies.sh"
change: "./requirements.txt"
A built-in Buildkite solution is a plus, but any custom solution using bash or python scripts would do.
Within a bash script that builds your pipeline, you could potentially run the git log command to see if a specific file has changed and then capture that in a variable to use when you are creating a step.
For example:
With this variable you can have a condition to only create the step if the variable has contents.
Git log documentation link: https://git-scm.com/docs/git-log