Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Is there a way to make conditional step run when if no following changes ?

In Bitbucket Pipelines there conditional steps changesets definition 

- step:
    condition:
         changesets:
             includePaths:
                 - "path1/*"
                 - "path2/*"

 I'm thinking to dynamically adjust steps sequence to use negate changesets

- parallel:
- step:
name: clear cache
condition:
changesets:
includePaths:
- "path1/*"
- step: name: Lint
condition:
changesets:
includePaths:
- "path1/*"
- parallel:
- step:
name: Deploy
- step:
name: Lint
condition:
NOchangesets:
includePaths:
- "path1/*"

 The logic is like

If has clear cache on selected changesets triggered
Do Lint togather
Else // no changesets trigger Lint goes to next parallel steps
Do Lint in Deployment

 

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 14, 2022

Hi @xicond,

changesets only supports includePaths at the moment. We have a feature request to support excludePaths which would allow you to do what you want to do:

If you'd be interested in that feature, please make sure to add your vote (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features. You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.

In the meantime, you could achieve what you want by adding in includePaths of the steps in the second parallel set, patterns that match the rest of the directories and files in your repo (the ones other than path1/*).

Kind regards,
Theodora

Hi @Theodora Boudale 

I already voted that feature request long time ago, but the excludePaths seems acting differently, from your explantion to use includePaths in different pattern

so actually what I expected is, if the pattern not exist then trigger the step.
so I cannot make out with different step, different pattern of includePaths

Not to exclude from the includePaths just to narrow down the includePaths

 

I can't think to inverted pattern, because it's too broad

 

CMIIW

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 24, 2022

Hi @xicond,

Apologies for the confusion, I think I misunderstood your requirements initially.

The inverted pattern will indeed not work for your use case, and I don't think there is a way to achieve what you want with the current features of pipelines.

What you want to achieve will be possible if the feature request for excludePaths is implemented; this way you could use excludePaths with path1/* for the steps of the second parallel set to achieve what you want.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events