Trying to add a Pipeline and get error "This repository does not have any files" on Commit File
Asked by Matt Mason:

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**


Answers:
author: Theodora Boudale
body: 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

comments: author: Matt Mason
body: This is the tutorial: [https://sonarcloud.io/project/configuration?analysisMode=BitbucketPipe\&id=owlbiomedical_swdev_owl](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


author: Theodora Boudale
body: 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


Tags: bitbucket-cloud

cloud

sonarcloud