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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Trying to add a Pipeline and get error "This repository does not have any files" on Commit File

Greetings 

I am trying to add Sonar Cloud to my repo.  I clicked Pipeline, and create bitbucket-pipelines.yml file but it wont let me commit this file in the root of the repo.

I clicked the Commit File button, and I have my SONAR_TOKEN saved per the tutorial.
After commit:

"This repository does not have any files

You can still commit changes and run the pipeline but it may lead to a failure."

I don’t really understand what I should do. If I try to hit the back button it discards the changes in I have in the bitbucket-pipelines.yml

1 answer

0 votes

Hi Matt and welcome to the community.

Could you please provide us with the URL of the tutorial you are following?

You mention that you want to add Sonar Cloud, but it looks that you're also trying to set up Pipelines, and I'm not sure which tutorial you are following.

Is the repo where you are trying to set this up empty (containing no commits/files)?

I have tried creating a bitbucket-pipelines.yml file in an empty repo of mine and it worked without issues, so it would be useful to have the tutorial and check the exact steps you are following.

Kind regards,
Theodora

This is the tutorial: https://sonarcloud.io/project/configuration?analysisMode=BitbucketPipe&id=owlbiomedical_swdev_owl

According to the tutorial, I need a pipeline.

I think the bitbucket-pipelines.yml is needed because I wanted to trigger a scan for every PR.

I look forward to hearing from you soon.

Best regards,

Matt

Hi Matt,

Thanks for the link. I am not able to access that link since it seems to be the configuration settings of your own private project.

I have an account with Sonar Cloud though, and navigating to the same configuration page for my project, I can see the instructions
1. Enable Pipelines
2. Add a repository variable
3. Create a bitbucket-pipelines.yml file

Could you please let me know:

  • Are you trying to create the bitbucket-pipelines.yml file by going to the Pipelines page of the repo in Bitbucket website, and then selecting one of the templates? Or are you following a different process? It's important to know what are the exact steps you take when you get his error.
  • Does the repo where you are trying to create the bitbucket-pipelines.yml file have already commits/files in it?

I am still unable to reproduce this error, and I can't find any similar issues reported before, so troubleshooting this may take some time, and it may be necessary to open a support ticket eventually.

If you want to set this up faster, instead of troubleshooting why this button doesn't work, I can suggest the following two workarounds:

  • If the repo is not empty, you can go to its Source page in Bitbucket website, select the 3 dots at the top right corner > Add file and then create the bitbucket-pipelines.yml file this way.
  • Another way to go around this would be to clone the repo locally, then create a bitbucket-pipelines.yml file in your local repo with the content you want, commit the file and push it to the Bitbucket repo.

Do any of these workarounds work for you?

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,785 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you