# GitHub Pages triggering builds incorrectly

**URL:** <https://drone.discourse.group/t/github-pages-triggering-builds-incorrectly/7954>\
**Category:** Drone Bugs\
**Created:** [November 25, 2019, 9:52pm UTC](https://drone.discourse.group/t/github-pages-triggering-builds-incorrectly/7954 "2019-11-25T21:52:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geek1011](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/geek1011/32/4393_2.png) [@geek1011](https://drone.discourse.group/u/geek1011)\
**Post date:** [November 25, 2019, 9:52pm UTC](https://drone.discourse.group/t/github-pages-triggering-builds-incorrectly/7954/1 "2019-11-25T21:52:03Z")

</div>

I have a repository with GitHub Pages enabled on the docs folder of the master branch. Every time I push a commit, a build like “github-pages[bot] promoted github-pages to 53d8a712” is created, which always fails due to the tag 53d8a712 not existing (it’s a commit). I don’t think this build should even exist in the first place.

When this occurs, the commit status is correct, but the deployments section on GitHub shows a failed deployment. The GitHub Pages commit status and the site itself is still correctly updated though.

Example: [https://cloud.drone.io/geek1011/kepubify/13](https://cloud.drone.io/geek1011/kepubify/13)

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [November 25, 2019, 10:55pm UTC](https://drone.discourse.group/t/github-pages-triggering-builds-incorrectly/7954/2 "2019-11-25T22:55:36Z")

</div>

If you do not want Drone to execute for promote / deploy events you should exclude in your yaml using the following syntax:

```auto
trigger:
  event:
    exclude: [promote]

```

The event coming from GitHub is a deployment event which triggers a promote pipeline (deploy hooks from GitHub map to promote events in Drone). At first glance this seems to be expected, although I admit I don’t have much time to dig any deeper. I would of course accept patches if there is room for improvement.

---

<div class="post-metadata">

**Author:** ![geek1011](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/geek1011/32/4393_2.png) [@geek1011](https://drone.discourse.group/u/geek1011)\
**Post date:** [November 25, 2019, 11:31pm UTC](https://drone.discourse.group/t/github-pages-triggering-builds-incorrectly/7954/3 "2019-11-25T23:31:58Z")

</div>

I’m considering this a bug, as it didn’t happen before AFAIK, it fails with an incorrect tag, and I don’t really see the point of having Drone trigger during a GitHub Pages build (I’d love to be proven wrong, though).

I’ll include your config tweaks as a workaround for now. Thanks!

Regarding a patch, I’d have to look into that later, as I don’t currently have time to figure out the details of this.

Edit: One thing I just noticed was that it only seems to happen after pushing a tag. I’m not 100% certain about this, though.
