Incorrect branch on webhook triggered build

benjamin's Avatar


07 Aug, 2019 08:37 PM

I have a project setup at, which connects to a BitBucket URL. It isn't using the BitBucket account, but rather the URL with credential authentication because I am not an administrator in that repository. The administrator has setup a web hook on the account which sends to the URL listed in the Settings > General > Webhook URL field. The hook successfully initiates builds when a commit is pushed up to Bitbucket, and it only initiates builds for branches that are listed in the Settings > General section. The problem is that it always triggers the build using the branch specified in the Settings > General > Default Branch field.

For example, I have three branches, named feature1, feature2, dev, and prod. The default branch is dev, and the allowed branches are feature2, dev and prod. If I commit a change to dev, everything builds and deploys fine. If I commit a change to feature1, nothing happens and I don't even see an Event registered. If I commit a change to feature2 or prod, then a build is triggered, but it builds against the dev branch and the commit is the most recent commit on that branch.

For the support team, you can see an example of this in the build at It was triggered by a commit pushed into the AzureDEV branch in BitBucket, but the build happened against the feature/pl-76-model-builder branch.

It seems to be able to detect from the web hook which branch was changed, as it doesn't trigger builds on the excluded branches, but it doesn't seem to set the branch correctly when triggering the build. How do I get this working correctly?

  1. 1 Posted by benjamin on 07 Aug, 2019 08:44 PM

    benjamin's Avatar

    Just as an update, it is readying the allowed branches from the appveyor.yml file, not from the website as I mentioned above. I removed an allowed branch from the website but left it in the appveyor.yml file (which is configured as an external URL), and a change to that branch still triggered a build, albeit still on the wrong branch.

  2. 2 Posted by Ilya Finkelshte... on 08 Aug, 2019 02:33 AM

    Ilya Finkelshteyn's Avatar

    Project is set up as a generic Git. Webhook payload for generic Git is not compatible with BitBucket. I am actually surprised it even started the build, it is probably compatible enough for that, but branch is not being parsed. Also generic Git does not support appveyor.yml, as described here.

    Maybe you can add repository owner as a user with Administrator role to the AppVeyor account and ask him to authorize Bitbucket at Thus OAuth token would be created and you will be able to re-create that project as a true Bitbucket one?

    Or other way around -- repo owner creates own AppVeyor account add adds you with some the role with enough permissions?

    Regardless of approach, I would strongly recommend set this project as a Bitbucket ones. This has a lot of benefits, including Pull requests builds.

  3. 3 Posted by benjamin on 12 Aug, 2019 02:52 PM

    benjamin's Avatar

    Can you provide documentation on what the webhook is looking for in the payload to determine branch? I can create my own microservice that receives the BitBucket webhook and sends a request to the AppVeyor webhook, I just need to know which format it needs to correctly parse the branch. Is it looking for a Github webhook request, or some other format?

  4. 4 Posted by Ilya Finkelshte... on 12 Aug, 2019 05:58 PM

    Ilya Finkelshteyn's Avatar
  5. Ilya Finkelshteyn closed this discussion on 12 Oct, 2019 09:01 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

13 Dec, 2019 05:26 PM
13 Dec, 2019 11:28 AM
12 Dec, 2019 09:36 PM
12 Dec, 2019 09:25 PM
12 Dec, 2019 06:01 PM


11 Dec, 2019 11:29 PM
11 Dec, 2019 08:47 PM
11 Dec, 2019 01:39 PM
10 Dec, 2019 12:29 AM
09 Dec, 2019 05:35 AM
07 Dec, 2019 04:20 PM