The requirement is -
I should be able to create a folder inside forked repo and in the newly created folder,i should next create two files.
The idea is to automate this process without having it to be done in local system.
Hey @Sravya Nalla and welcome to the Community!
You can leverage the Create a commit by uploading a file endpoint to commit the files you want using the rest API.
Following is an example API request to that endpoint using curl :
curl -X POST -u USERNAME:APP_PASSWORD https://api.bitbucket.org/2.0/repositories/WORKSPACE/REPOSITORY/src -F /my_folder/myfile.txt=@myfile.txt
This will create a new commit on top of the main branch, uploading the local file myfile.txt to the directory my_folder inside the repository. If the destination folder does not exist in the repository, it will get automatically created.
In this example, we are using basic authentication to authenticate the request, where :
For additional details on that particular endpoint, you can refer to the official API reference below :
Hope that helps! You can try following the example above and let us know how it goes.
Thank you, @Sravya Nalla !
Patrik S
Hi @Patrik S , thanks for the response!!
Here i don't want to upload any files from local system instead I want to create folder and files(ymls) inside that folder using endpoints.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.