Ci_pipeline_iid

Hey everyone,
I want to use the CI_PIPELINE_IID in my project as a build number, but I noticed something weird.
When I echo the value of it in the pipeline, it increments by 1. I want it to increment like it should, but once for each pipeline. What it means is, if I use this value, it increments by 2 for each pipeline instead of 1 - it increments by 1 for the echo, and then increments by 1 more for the pipeline itself.
I can use a workaround and get the CI_PIPELINE_IID + 1 as my build number, but I was wondering if there is a better way.

Thanks

Hi @elran
I don’t think the CI_PIPELINE_IID increments by 2 anywhere and definitely not, because you echo it.
The IID represents the Pipeline number in your project. For example in MRs where you can have MR pipeline and branch pipeline each has it’s own IID.