# DRONE\_REPO\_BRANCH is wrong

**URL:** <https://drone.discourse.group/t/drone-repo-branch-is-wrong/9615>\
**Category:** Drone Support\
**Created:** [September 5, 2019, 8:38am UTC](https://drone.discourse.group/t/drone-repo-branch-is-wrong/9615 "2019-09-05T08:38:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bastienbc](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bastienbc/32/5373_2.png) [@bastienbc](https://drone.discourse.group/u/bastienbc)\
**Post date:** [September 5, 2019, 8:38am UTC](https://drone.discourse.group/t/drone-repo-branch-is-wrong/9615/1 "2019-09-05T08:38:43Z")

</div>

Hi,

I have a project for which the main branch in bitbucket server is set to _develop_.  
Many of my plugins have a specific behavior when the current branch is the main branch, and during my tests on other project which have a _master_ main branch, everything was working well.

But even if the main branch is set to _develop_, the DRONE\_REPO\_BRANCH is set to _master_.  
Is it a bitbucket related bug like the [CI SKIP] one? Or is there something else?

![image](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/b/be0e10c9c72ee0652baa694d501f4e6637d8f677.png)

![image](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/7/79c192a753ad1161dd5c42f87e3870a8ac4786df.png)

---

<div class="post-metadata">

**Author:** ![lr228](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@lr228](https://drone.discourse.group/u/lr228)\
**Post date:** [January 29, 2022, 8:30pm UTC](https://drone.discourse.group/t/drone-repo-branch-is-wrong/9615/2 "2022-01-29T20:30:12Z")

</div>

This is happening with me but with Gitea. The default branch set in Gitea for my repos is “main”, but the docker plugin skips image build and push when the commit was to branch “main” but was not tagged. Gitea sends a “default\_branch” key in the webhooks, perhaps the value here should be used as the name of the default branch? (code [here](https://github.com/drone-plugins/drone-docker/blob/master/cmd/drone-docker/main.go#L330))
