Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't I use a YAML anchor for a tags pipeline?

Paul S
Contributor
October 3, 2024

When I have the following in my pipelines file, there is an error when the pipeline runs or if I try to run it:

tags: # Pipelines that will be triggered when a tag is pushed
'*.*.*':
- step: *publish-package

with the error 
Screenshot 2024-10-03 at 13.47.34.png
But it works with:

tags: # Pipelines that will be triggered when a tag is pushed
'*.*.*':
- step:
script:
- echo "TAGS"

The documentation 

https://support.atlassian.com/bitbucket-cloud/docs/step-options/#The-Step-property is  confusing because it insists that the script property is required, yet it works perfectly without for some pipeline:

branches: # Pipelines that run automatically on a commit to a specific branch, can also be triggered manually
'**': # This runs as default on all branches
- step: *build-and-test

What's going on?

1 answer

1 accepted

0 votes
Answer accepted
Paul S
Contributor
October 3, 2024

After many hours of banging my head against the wall, I finally got to the bottom of this.

Turns out that one of the script lines for the publish-package step was

- git commit -m "Next Snapshot: ${PACKAGE_VERSION}"

Take careful note of the ':' within the delimited string - that was the offending character in the file. Once I removed the ':' all was well.

Nice bug. 

Suggest an answer

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

Atlassian Community Events