According to this reference, the correct usage for these cases id and(not(failed()), not(cancelled()))
: https://blogs.blackmarble.co.uk/rfennell/using-azure-devops-stage-dependency-variables-with-conditional-stage-and-job-execution/
[![enter image description here][1]][1]
So, the solution then:
jobs:
- ${{ each package in parameters. librariesToBePublished }}:
- job: Publish_package_${{ replace(package.name, '-', '_') }}
displayName: "Publish ${{ package.name }}"
dependsOn:
- ${{ each dep in package.dependsOn }}:
- Publish_package_${{ replace(dep, '-', '_') }}
condition: |
and(
not(failed()),
not(cancelled()),
eq('${{parameters[package.name]}}', true)
)
[1]: https://i.sstatic.net/AJ12GX78.png