Github Post Commit Hook Config

Michael Telford's Avatar

Michael Telford

04 Dec, 2019 04:33 PM

Hi,

I have a Ruby Github project on rubydoc.info which I'd like updated when I push to origin master. My project docs are located at:

https://www.rubydoc.info/github/michaeltelford/wgit/master

I've tried setting up a Webhook on Github using the URL: https://www.rubydoc.info/checkout

But Github's ping service shows the response as 200 OK with a body of INVALIDSCHEME and I can confirm that the docs have not synced with that of the origin master branch. I've tried using http in case that was the invalid scheme but it redirects back to https. I've also tried both JSON and application/x-www-form-urlencoded payloads to no avail.

Has anybody any idea's of the correct Webhook configuration needed to achieve this?

Thanks in advance,
Michael

  1. 1 Posted by Michael Telford on 04 Dec, 2019 04:45 PM

    Michael Telford's Avatar

    I've also read the article: https://rubydoc.tenderapp.com/kb/git-integration/adding-a-rubydocin...

    But this suggests an official Github service/app/integration, all of which are now deprecated on Github.

  2. 2 Posted by Michael Telford on 13 Dec, 2019 04:00 PM

    Michael Telford's Avatar

    So I've added a step to my CI workflow (rather than setting up a post commit hook on Github) which updates the rubydoc.info site by curling the server:

    $ curl 'https://www.rubydoc.info/checkout' \
      -H 'User-Agent: curl' \
      -H 'Accept: */*' \
      -H 'Accept-Language: en-GB,en;q=0.5' --compressed \
      -H 'Content-Type: application/x-www-form-urlencoded' \
      -H 'X-Requested-With: XMLHttpRequest' \
      -H 'Origin: https://www.rubydoc.info' \
      -H 'Connection: keep-alive' \
      -H 'Referer: https://www.rubydoc.info/find/github?q=wgit' \
      --data 'scheme=git&url=git%3A%2F%2Fgithub.com%2Fmichaeltelford%2Fwgit&commit='
    

    You can do the same by replacing the wgit repo/gem name with your own.

    I still think that the original question/issue requires a solution however since you should be able to update the docs via a Github hook. If anybody knows the correct Github hook config, please leave a comment.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? 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