# Failed to add GitHub trigger

**URL:** <https://community.codefresh.io/t/failed-to-add-github-trigger/278>\
**Category:** Pipeline Triggers\
**Created:** [February 5, 2020, 5:45am UTC](https://community.codefresh.io/t/failed-to-add-github-trigger/278 "2020-02-05T05:45:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![grumpydude](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@grumpydude](https://community.codefresh.io/u/grumpydude)\
**Post date:** [February 5, 2020, 5:45am UTC](https://community.codefresh.io/t/failed-to-add-github-trigger/278/1 "2020-02-05T05:45:11Z")

</div>

Hello,

I’m setting up my first CodeFresh pipeline using a specification and cannot get the GiHub trigger to verify. The portal notes that it **Failed to add Trigger to GITHUB**.

If I use the codefresh cli, I get the following error:

```auto
Error: "{\"status\":500,\"code\":\"1001\",\"name\":\"INTERNAL_SERVER_ERROR\",\"message\":\"Failed to run pipeline\",\"context\":{}}"

```

Here’s my trigger definition:

```auto
  triggers:
  - name: "push-to-master"
    branchRegex: "/master/gi"
    branchRegexInput: "regex"
    commentRegex: "/.*/gi"
    description: "Trigger on Push to Master"
    events:
    - "push.heads"
    modifiedFilesGlob: "{awesome/src/**,awesome/src/!(*.md)}"
    provider: "github"
    pullRequestAllowForkEvents: false
    repo: "ficticious-company/lots-of-awesome"
    type: "git"

```

When I add a trigger via the portal, it verifies successfully but the configuration appears to be identical. Any ideas?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![grumpydude](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@grumpydude](https://community.codefresh.io/u/grumpydude)\
**Post date:** [February 5, 2020, 11:00pm UTC](https://community.codefresh.io/t/failed-to-add-github-trigger/278/2 "2020-02-05T23:00:43Z")

</div>

As it turns out, the trigger needs to have additional fields, like this:

```auto
  triggers:
  - name: "push-to-master"
    branchRegex: "/master/gi"
    branchRegexInput: "regex"
    commentRegex: "/.*/gi"
    context: "github"
    contexts: []
    disabled: false
    events:
    - "push.heads"
    modifiedFilesGlob: '{awesome/src/**, awesome/src/!(*.md)}'
    options:
      noCache: false
      noCfCache: false
      resetVolume: false
    provider: "github"
    pullRequestAllowForkEvents: false
    repo: "ficticious-company/lots-of-awesome"
    type: "git"

```

---

<div class="post-metadata">

**Author:** ![kristofer](https://sea1.discourse-cdn.com/flex019/user_avatar/community.codefresh.io/kristofer/32/19_2.png) [@kristofer](https://community.codefresh.io/u/kristofer)\
**Post date:** [February 7, 2020, 1:11am UTC](https://community.codefresh.io/t/failed-to-add-github-trigger/278/3 "2020-02-07T01:11:15Z")

</div>

Hey, thanks for the heads up! Appreciate the detail. I’ll see if w can’t add this to the docs. 🙂

---

<div class="post-metadata">

**Author:** ![grumpydude](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@grumpydude](https://community.codefresh.io/u/grumpydude)\
**Post date:** [February 7, 2020, 1:31am UTC](https://community.codefresh.io/t/failed-to-add-github-trigger/278/4 "2020-02-07T01:31:26Z")

</div>

I’ve not tested the negative glob, but it appears to match the upstream glob specification. Before you document it that way, you might need to double check it all yourself.
