derive github api url

15 views
Skip to first unread message

Jeremy Marshall

unread,
Dec 16, 2018, 4:30:56 AM12/16/18
to Jenkins Developers
I'm writing a plugin to push comments to a pull request in github.

I really don't want to reinvent anything so is there a way to determine the github api url for the project?

There could be multiple github urls defined in an installation, covering different organisations and possibly Github enterprise. I was thinking of leveraging the defined values, rather than have to duplicate config. All the config in the job I want is an option credential

Thanks

Oleg Nenashev

unread,
Dec 16, 2018, 6:44:41 AM12/16/18
to Jenkins Developers
GitHub plugin offers a GItHub project reference Job property.
I believe it is a way to go if you have a single GitHub project configured for your job.
For multiple projects there is no APIs right now AFAIK, but extending the GitHub plugin could be a reasonable RFE

Best regards,
Oleg

Jeremy Marshall

unread,
Dec 16, 2018, 4:53:52 PM12/16/18
to Jenkins Developers
 I was worried that would be the case. I had a look around and couldn't find anything that didn't make assumptions - such as `api.github.com

I was planning to use branch pipelines for PR's. I think just an additional environment variable in the job pointing to the API root URL would be a way to go. I'm not so worried about jobs with multiple SCM definition but just if people are using github and a some github enterprise servers too on separate projects

I'll take a look at the github plugin

Thanks
Jeremy
Reply all
Reply to author
Forward
0 new messages