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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,458,353
Community Members
 
Community Events
176
Community Groups

The pipe "trigger-pipeline" only works for branches, and not tags

Edited

I have a pipeline that's using the pipe atlassian/trigger-pipeline:5.0.1 to trigger a pipeline in a different project.

It works perfectly for branches, but not for tags.

The error it gets is:

Digest: sha256:f6effedb090ab2c1e936b7b382dd4512b810a52033706459095e6089fc7e19c7
Status: Downloaded newer image for bitbucketpipelines/trigger-pipeline:5.0.1
DEBUG: Starting new HTTPS connection (1): bitbucket.org:443
DEBUG: https://bitbucket.org:443 "GET /bitbucketpipelines/official-pipes/raw/master/pipes.prod.json HTTP/1.1" 200 None
INFO: Fetching the tag info for tag:v1.0.14
DEBUG: Starting new HTTPS connection (1): api.bitbucket.org:443
DEBUG: https://api.bitbucket.org:443 "GET /2.0/repositories/steve_ie/steve/refs/tags/v1.0.14 HTTP/1.1" 200 None
DEBUG: Starting new HTTPS connection (1): api.bitbucket.org:443
DEBUG: https://api.bitbucket.org:443 "POST /2.0/repositories/steve_ie/steve/pipelines/ HTTP/1.1" 400 160
✖ Error: {"error": {"message": "Bad request", "detail": "bitbucket-pipelines.yml not found.", "data": {"key": "result-service.pipeline.yml-not-found", "arguments": {}}}}



bitbucket-pipeline.yml definitely exists, on all branches on the target project. Also the target project definitely has the tag "v1.0.14"

 

How do I get atlassian/trigger-pipeline:5.0.1 to work correctly with tags?

 

1 answer

1 accepted

2 votes
Answer accepted
Patrik S Atlassian Team Jan 19, 2023

Hello @Steve Annett ,

Welcome to Atlassian Community! 

I was able to reproduce the same error message when the branch where this tag was created had a bitbucket-pipelines.yml file that did not contain a definition for the tag I configured in the pipe.

So I think the message might be misleading in this case, and it doesn't necessarily mean the bitbucket-pipelines.yml does not exist for the branch where the tag was created, but also that a tag-triggered pipeline is not defined in that branch.

You can use the following command to check at which branch a tag was created : 

git log -1 --pretty='%D' TAG_NAME

And then you can go to that branch's bitbucket-pipelines.yml file and check if there's a tag definition that matches the name/pattern of the tag you are trying to trigger. If there isn't, or if the tag pattern does not match the tag you are triggering, this is the reason why the pipe is failing.

To solve it, you can edit the yml file of that particular branch to include a tag section as well with a name/glob pattern that matched the tag configured in the pipe.

Hope that helps! Let me know in case you have any questions.

Thank you, @Steve Annett 

Patrik S

Thanks for your help! This is exactly it

 

I mistakenly thought it would run the default declaration in the target project, but that's not the case, it needs a tags declaration

Adding a tags declaration on the triggered project fixes it

  tags:
    '*': # Tag of any name
      - step: *build-java
Like Patrik S likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events