Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,507
Community Members
 
Community Events
176
Community Groups

trigger an action when repo is forked?

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?

1 answer

0 votes

Hi Max,

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.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events