Hi @mhumair7
You can’t directly use the Bitbucket Cloud API to list all repositories with secrets. The API doesn’t provide a specific endpoint for that. But, you can list all repositories and then check each one for secrets in the pipeline environment variables. Here’s the API to list repositories:
https://api.bitbucket.org/2.0/repositories/{username}
Want me to whip up a Python script (or any other language) to automate the process of checking each repository for secrets? Let me know, and I’ll get on it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just a side question though @Stefano Galati . Is there a way to export meta data like pull requests and stuff in a given workspace or project from Bitbucket Cloud ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure thing, @mhumair7 ! You can export metadata like pull requests and other details from a given workspace or project in Bitbucket Cloud.
Here are the main steps:
Use the API to List Repositories with a get tonretrieve a list of all repositories in the workspace.
GET https://api.bitbucket.org/2.0/repositories/{workspace}
After that fetch Pull Requests for all repos
GET https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests
Then export other metadata like commits, issues, etc., by using their respective API endpoints.
Like before if you need help with thé code let me know 😉
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Stefano Galati . One last thing. I'm exporting pull requests but is there a cap to it ?
Because it seems all of the pull requests aren't exporting for a given repo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @mhumair7
I’m in holiday with not a good connection sorry for the late..
I will check asap and give you a response
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Stefano Galati Can you guide me related to this module too ?
https://atlassian-python-api.readthedocs.io/bitbucket.html#manage-repositories
I'm unable to find a method that can help me find users permissions on a given repo like the one that exists to get for groups :
repository.group_permissions.each():
https://atlassian-python-api.readthedocs.io/bitbucket.html#manage-repositories
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.