Code Monkey home page Code Monkey logo

Comments (9)

laurentj avatar laurentj commented on May 27, 2024

I also have this kind of issue after a push on github:

TypeError: Cannot call method 'indexOf' of undefined
    at pushJob (/home/strider/strider/node_modules/strider-github/lib/webhooks.js:126:19)
    at startFromCommit (/home/strider/strider/node_modules/strider-github/lib/webhooks.js:42:16)
    at receiveWebhook (/home/strider/strider/node_modules/strider-github/lib/webhooks.js:222:3)
    at callbacks (/home/strider/strider/node_modules/express/lib/router/index.js:164:37)
    at projectProvider (/home/strider/strider/lib/middleware.js:107:3)
    at callbacks (/home/strider/strider/node_modules/express/lib/router/index.js:164:37)
    at Promise.<anonymous> (/home/strider/strider/lib/middleware.js:201:5)
    at Promise.<anonymous> (/home/strider/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:162:8)
    at Promise.EventEmitter.emit (events.js:95:17)
    at Promise.emit (/home/strider/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:79:38)

So it is caused by this line:

if (payload.ref.indexOf('refs/heads/') === 0) {
    branchname = payload.ref.substring('refs/heads/'.length)
    ref = {
      branch: branchname,
      id: payload.after
    }
  } else {

although, in the payload in the request, I have the ref property

  "ref": "refs/heads/jelix-1.6.x",

from strider-github.

oliversalzburg avatar oliversalzburg commented on May 27, 2024

@laurentj That was fixed by #16 Unless I'm mistaken :)

from strider-github.

laurentj avatar laurentj commented on May 27, 2024

@oliversalzburg yes, you're right. I didn't saw the fix about JSON.parse...

from strider-github.

niallo avatar niallo commented on May 27, 2024

Latest HEAD of strider-github is now on npm as v1.2.2. But you can confirm that there is still an issue with Github web hooks?

from strider-github.

oliversalzburg avatar oliversalzburg commented on May 27, 2024

@niallo Our setup seems to work fine now. I think the problem I was seeing is only related to that initial ping sent by GitHub when the webhook is set up.

from strider-github.

cusspvz avatar cusspvz commented on May 27, 2024

Same error this side, maybe npm version is outdated?

from strider-github.

knownasilya avatar knownasilya commented on May 27, 2024

@cusspvz did you solve the issue?

from strider-github.

cusspvz avatar cusspvz commented on May 27, 2024

Yes, I don't quite remember this but things are working flawless at the time.

from strider-github.

knownasilya avatar knownasilya commented on May 27, 2024

Thanks @cusspvz

from strider-github.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.