Has anyone gotten the Github Redmine Service Hook working?

Added by Aron Rotteveel over 6 years ago

Github recently released it's own Redmine Service hook and I am trying to get it working with one of my (private) Github repositories.

What I've done:

  1. Create github repostitory
  2. Create local repository on our Redmine server
  3. Fill in API key and other info in Github
  4. Add local (bare) repository path to the Redmine project

What is working:

  • Local repository browsing

What is not working:

  • Pushing data to Github results in the hook being triggered, but the repo is not being updated. I see this in my apache logs:

fatal: Invalid revision range 69e5fe4855fcd6956b36c696c3870c71f960686e..master

Any help is appreciated.

Replies (9)

RE: Has anyone gotten the Github Redmine Service Hook working? - Added by Chris Fields over 6 years ago

No, the Redmine hook is almost worthless. See this link. I think it's being worked on.

RE: Has anyone gotten the Github Redmine Service Hook working? - Added by Joshua Villagomez over 6 years ago

Aron, I tried getting it to work too, and ran into the same issue. Got the same error in Apache2. Looking over the issue, the hook is not what it appears to be. It tells Redmine to fetch its local repository. It doesn't pull from remote Github repositories. The Chiliproject guys are actually recommending to remove that hook from Github. I think I'll be trying out this plugin (https://github.com/koppen/redmine_github_hook).

RE: Has anyone gotten the Github Redmine Service Hook working? - Added by David JB about 6 years ago

Ahh fantastic. Finally, a solid answer to this question that I've been grappling with all day.

Is there any reason why the Git plugin can't just do a fetch during the fetch_changesets? Seems that since it's already calling a bunch of git commands, why not chuck a 'git fetch' in there as well (or else provide an option)?

RE: Has anyone gotten the Github Redmine Service Hook working? - Added by Tobias Fischer almost 5 years ago

Github Redmine Service Hook still doesn't work. Payload is sent but repository isn't going to be refreshed.

Anyway, the plugin mentioned by Joshua (https://github.com/koppen/redmine_github_hook) works well with Redmine 2.1.6.
Don't forget to grant the correct permissions for the bare github repository to the Redmine-Webserver user (e.g. 'apache' or 'www-data'). This user also needs its own SSH key, because the 'git fetch' command is executed by the redmine plugin => the redmine webserver user.

RE: Has anyone gotten the Github Redmine Service Hook working? - Added by Chris Fields almost 5 years ago

Tobias, I don't use SSH keys and it works. Since the git repo local to redmine is read-only and a mirror downstream from the github repo, I use the http or git read-only link (which doesn't require SSH keys).

RE: Has anyone gotten the Github Redmine Service Hook working? - Added by Tobias Fischer almost 5 years ago

Chris, I forgot to tell that my test repository is a private github repo.
Therefore I needed SSH authentification to update my local bare repository. Otherwise, with the http or git read-only link, it would have asked me for username and password at every time...

I didn't try the "official" Github Redmine Service Hook with a public github repo, but with my private repo and SSH authentification it didn't work. I therefore needed the "redmine_github_hook" plugin...

RE: Has anyone gotten the Github Redmine Service Hook working? - Added by Adrien Crivelli over 4 years ago

The official Redmine hook on Github also failed for me. Installing https://github.com/koppen/redmine_github_hook was easy and it works (as long as the local repository is writtable).

RE: Has anyone gotten the Github Redmine Service Hook working? - Added by Craig Rodrigues over 4 years ago

Don't use the default Github Service hook for Redmine.

I can confirm, that https://github.com/koppen/redmine_github_hook
works great. Use that instead.

RE: Has anyone gotten the Github Redmine Service Hook working? - Added by Andriy Lesyuk over 3 years ago

Github Service hook for Redmine is now used by SCM Creator to keep Github repos in sync.

(1-9/9)