Currently, the `condition` option for conditionally triggering a step can only look at the changeset of a commit. It would be great to have a condition based on files in the repo, not just changed ones.
This would do wonders for common shared pipelines configuration to be more modular and/or universal.
Example:
pipelines:
default:
- step: name: Maven Deploy script: - mvn deploy
- step:
name: NPM Install
script:
- cd $NPM_DIRECTORY
- npm install
condition:
files:
includePaths:# if any directory has a package.json
- "**/package.json"
Hi @fo_connor,
Thank you for reaching out and for the suggestion.
I can create the feature request; I would just like to ask for some clarification first, to better understand what you're looking for and include it in the feature request:
Certain files may exist in some branches of the repo, but not in others yet (e.g. you may introduce a new file in a branch that hasn't been merged to other branches yet). Would you like this feature to check files in the source code of the commit the build is running for, or check files in the source code of all branches of the repo?
Kind regards,
Theodora
Hi,
Thank you for your input.
I actually saw that we have an open feature request for the ability to have custom conditions in a step, which would cover you case:
I went ahead and added a comment to that ticket with your use case. You are more than welcome to also leave a comment with feedback, and you can vote for that feature request by selecting the link Vote for this issue.
In the meantime, I think you may be able to implement this with dynamic pipelines:
The page I shared has links to resources. If you have any questions about dynamic pipelines, you can reach out to the 'Forge for Bitbucket Cloud' group here:
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for linking that, it seems a bit more flexible than what I've proposed, but should probably utilize the `condition` section.
As for Dynamic Pipelines - it is a cumbersome way to fix any of these issues. There is too much learning curve and code to write for something that should be a core feature.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the feedback and for your input on the feature request. The reason we often mention dynamic pipelines is that they offer the possibility to solve some of the uses cases now, until another solution becomes available. I certainly understand though that there is complexity involved compared to configuring something in the yml.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi fo_connor!
You can submit suggestions directly to Atlassian's product dev teams by creating an issue in their product's respective Jira project. Here is the bitbucket cloud team's project.
Hope this helps,
Nick from Isos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.