Would like to trigger a pipeline when a branch is created in GitHub Enterprise


I would like to trigger a pipeline when a new branch is created in a repo in our GitHub Enterprise. I noticed that the webhook definition has that selected for Drone, but I can’t find any trigger event that would match a new branch creation activity.

Any help would be greatly appreciated. Thanks in advance.

When a new branch is created the event type is push and the value of DRONE_COMMIT_BEFORE is set to 0000000000000000000000000000000000000000 . You can trigger on push events, but some scripting may be required in your pipeline to check the before commit value to determine whether or not to take action.

  - push

Thanks Brad, this is exactly what I needed to alleviate a problem I was having getting a baseline SonarQube analysis done on each branch prior to the developer making changes on the new branch.

Thanks again.