You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I would like to trigger an action when a repo is forked, e.g. when I fork Repo A, I would like to trigger a change to the repository settings on the fork, Repo B.
For example, Bitbucket currently (and very wrongly) assumes that PRs in repos that were forked from an upstream, should target the upstream by default. There is currently no way to change this.
Since there is no way to change this and no merge check available based on the target repo, my workaround is to create a default pull request task on PRs that basically says "CHECK THE TARGET REPO" and then have a merge check for unresolved PR tasks.
What I'd like to do is to have this default pull request task created (and the corresponding merge check enabled) every time the upstream repo is forked.
Better yet, is there a way to create a set of repository settings that is automatically applied to each repo that is forked from the upstream?
You could use a webhook with trigger Repository : Fork for this purpose. With such a webhook, Bitbucket will send a request to a server of yours every time the repo is forked, and you can then run an API call on your server in order to update certain settings of the fork repo.
This is possible for settings that can be updated via our API. E.g. it is possible to create branch permissions via API:
However, I'm afraid that it is not possible to create default tasks via API. We have a feature request for providing an API for PR tasks: https://jira.atlassian.com/browse/BCLOUD-16682 Until this is implemented, default tasks need to be created manually from the Repository settings.
We also have a feature request for allowing users to set the default target repository for forks https://jira.atlassian.com/browse/BCLOUD-20010 I would encourage you to add your vote and feedback to that feature request if that's something you'd be interested in, as this helps our product managers better understand the demand for features.