Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to add a status badge?

Elizabeth C
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 7, 2023

It's a Maven project using Java.

1 answer

2 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 8, 2023

Hi Elizabeth and welcome to the community!

Are you referring to a status badge of a Bitbucket Pipelines build?

If so, and if your repo is public, you can use shields.io to generate a badge:

If your repo is private, you can generate your own badge during the build, upload it to Bitbucket Downloads, and then reference it in your README. You can see more details here:

Kind regards,
Theodora

Bitwise DEVS February 26, 2024

Hi @Theodora Boudale

We are currently trying to do this for the first time, is there a way to determine if a step(s) in a pipeline fails so we can generate an appropriate badge for it?


Thanks!

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2024

Hi @Bitwise DEVS,

If you want to do that during the pipeline build, there is an option to add an after-script in a step:

The pipeline variable BITBUCKET_EXIT_CODE can be used in the after-script to determine if the script in the step has succeeded or failed.

If you want to get that info outside of Pipelines (e.g. in a script running on your server), this API endpoint will return the status of a build:

Kind regards,
Theodora

Like # people like this
Bitwise DEVS February 27, 2024

Thanks!

Like Theodora Boudale likes this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 28, 2024

You are very welcome! Please feel free to reach out if you need anything else!

Bitwise DEVS February 28, 2024

I actually created a separate question/thread instead which is more about how to utilize after-script.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 4, 2024

Hi @Bitwise DEVS,

I will respond to the question you created.

Kind regards,
Theodora

Bitwise DEVS March 6, 2024

Going back with the Bitbucket Downloads question, if we have existing file example badge.svg then we upload a new file using 

atlassian/bitbucket-upload-file is it going to replace it or it will rename the new file with for example badge-1.svg?


Thanks!
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2024

Hi @Bitwise DEVS!

If you upload a new file with the same name as an existing file in the Downloads, the new file is going to replace the existing one.

Kind regards,
Theodora

Bitwise DEVS March 6, 2024

Thanks!

Like Theodora Boudale likes this

Suggest an answer

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

Atlassian Community Events