How can I programmatically add issues on my Github repository using C#?
I have an Error Handler library (ErrorControlSystem
) to attach that in a win application to raise that exceptions on a SQL table.
Now, I want to store ErrorControlSystem
self exceptions without the target app exceptions on self Github repository issues.
How to can I do it?
You can use the GitHub API for that. Create a webhook and add an issue the following way:
Example from https://developer.github.com/v3/issues/
So all you have to do is a HTTP - POST command to add an issue.
You can do a post request using a WebRequest.
Complete description for the api: https://api.github.com/repos/octocat/Hello-World/issues/1347
Complete C#-Example:
Now your issue has been created and response contains the response from GitHub
This is the "fast, easy" solution. If you want do do more with GitHub issues, @VonC's answer might be the better one as it offers a more object-related solution