Hello,
I've been trying to create reusable steps to reduce lines on my pipeline.yaml, but I've been encountering this error: Property name is not allowed.yaml-schema: Pipeline Items.
Specifically, I encounter the error if I attempt to override some values (e.g., name).
Here's how it would look
image: atlassian/default-image:3 definitions: steps: - step: &reuse-no-error name: Reusable step script: - echo "Hello World" - step: &reuse-has-error name: Reusable step # Property script is not allowed.yaml-schema: Pipeline Items script: # Property script is not allowed.yaml-schema: Pipeline Items - echo "Hello World" pipelines: branches: test: - step: *reuse-no-error - step: # happens even if I replace this "- step:" with "- <<:" directly <<: *reuse-has-error name: Change name
According to the validator (https://bitbucket.org/product/pipelines/validator), this is valid.
Edit: To add, I've committed the change but was told by bitbucket that there was an error in the pipelines.branches.test.0 as well. I'll try to replicate the issue and update this post shortly.
Edit2: The above yaml file causes the error: There is an error in your bitbucket-pipelines.yml at [pipelines > branches > test > 1]. Step is empty, null, or missing.
RESOLVED: Apologies, the references I was following had misaligned the step and << lines. After adding an indent to the << line, things worked as expected.
Cheers,
Kevin
@Kevin Tolentino welcome to the Atlassian community
In the future if you can post the solution in the answers and accept it then others will be able to more easily find it. I posted it below if you can accept this answer.
RESOLVED: Apologies, the references I was following had misaligned the step and << lines. After adding an indent to the << line, things worked as expected.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.