Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create an issue with image via GitHub API

Tags:

I am creating issues with https://developer.github.com/v3/issues/#create-an-issue. Is it possible to attach images to message body?

I tried 'Accept', 'application/vnd.github.v3.html+json'and emmbeded the image as img elment base64 encoded. The image will not show, but the ticket editor shows the img element.

like image 387
Stephan Ahlf Avatar asked Feb 24 '15 18:02

Stephan Ahlf


People also ask

How do I add an image to a GitHub issue?

To attach a file to an issue or pull request conversation, drag and drop it into the comment box. Alternatively, you can click the bar at the bottom of the comment box to browse, select, and add a file from your computer. Tip: In many browsers, you can copy-and-paste images directly into the box.

How do I assign an issue in GitHub?

On GitHub.com, navigate to the main page of the repository. Under your repository name, click Issues or Pull requests. Open the issue or pull request that you want to assign to someone. If no one is assigned to an issue or pull request, click assign yourself to assign yourself.

How do I create a GitHub repository API?

Show activity on this post. Go to Settings -> Developer Settings -> Personal Access Token Under OAuth Apps. Now, Generate a New Access token with Required privileges enabled. Ignore This if you already have one.


1 Answers

There is no simple solution to this. The official docs say nothing about that which means it's not supported.

The GitHub.com authentication works based on cookies while the API authentication uses tokens/passwords. That means if you really want to hack the things to upload your image using GitHub, you have to login using a cookie which is probably more difficult than using a third-party image hosting website.

For example, you could just upload your image to imgur and then add it in the issue body:

![image-title](http://i.imgur.com/x....xx.png) 

This will anyway be proxied by GitHub proxy and will be served offer HTTPs.

like image 133
Ionică Bizău Avatar answered Nov 07 '22 04:11

Ionică Bizău