Is it possible to push out a change to all the repos within a project? And can we enforce branch protection as well??
Hi @msameer,
You could use the following API endpoint:
This creates a new commit by uploading a file to a repo. You would need a separate API call per repo, but you could write a script that does that. If the file already exists in the repo, its content will be replaced with the content of the file you are uploading.
If you don't specify a branch, the file will be uploaded to the repo's main branch. You can also specify a branch:
curl -X POST https://api.bitbucket.org/2.0/repositories/<workspace-id>/<repo-slug>/src \
--header 'Authorization: Bearer <token>' \
-F File1.json=@File1.json -F branch=feature-branch -F message="some commit message"
You can use branch permissions to restrict who can push or merge PRs to certain branches:
Please feel free to reach out if you have any questions!
Kind regards,
Theodora
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.