Skip to content
Source
Sign inSign up

Add images and videos

Issues and pull requests / Issues

Add images and videos to issues and comments

You found a bug, and a screenshot or a short video shows it better than words. Add the file to your issue or comment, also when you do not have write access to the repository.

5 min read

You need to be signed in, and able to comment on the repository.

1. Add the file

  1. Open the repository, then start an issue, a comment or a pull request.
  2. Add the file in one of these ways:
    • Click Attach files under the text field, then choose one or more files.
    • Paste an image into the text field, for example a screenshot from your clipboard.
    • Drag files from your computer and drop them on the text field.

Every editor of a repository has the Attach files button. That includes issues, comments, pull requests, line comments, review summaries, and Community posts and answers. You can also attach files from a terminal: see Attach from a terminal.

Note

An image can be up to 10 MiB, and a video up to 100 MiB. See What you can attach.

2. Wait for the upload

The editor uploads the file to the repository. Until the upload ends, your text shows ![Uploading screenshot.png...]() where the file goes. Then the placeholder becomes the link to the file:

![screenshot.png](https://forge.example/@acme/app/assets/attachments/3f8a...c21e.png)

<video src="https://forge.example/@acme/app/assets/attachments/9b0d...47aa.mp4" controls></video>
  • An image becomes Markdown. The text in the square brackets is the file name. Change it to a short description, so that screen readers can read the image.
  • A video becomes a <video> tag with play controls.
  • If an upload fails, the editor removes the placeholder and shows the reason under the text field.

3. Preview and post

  1. Click Preview to see the file in your text.
  2. Post your text as usual.

Your readers see the image or the video in the text. To see its details, they open it full screen. See See images and videos full screen.

While screening reads your text

If you do not have write access, screening reads your text before other people see it. Your attached files stay hidden with your text.

  • You see your own files, in Preview and in your text after you post it.
  • When screening shows your text, your files show too. A maintainer who shows your text also shows your files.
  • If screening or a maintainer rejects your text, your files stay hidden.

See what runs on an issue or a pull request shows how screening works. If you have write access, your files show at once.

Items that sync with GitHub

The link to your file is a full URL, so it also works on GitHub. GitHub shows the file only when the assets of the repository are public. Who can see your assets says when they are.

If the assets are private, the editor warns you: "GitHub readers will not see the attached files. The assets of this repository are private."

Private pull requests

The files of a private pull request stay as private as the pull request.

  • On a private pull request, the editor uploads your files to the assets of its private companion, <owner>/<name>.private, not to the public repository. Only people with write access can open them there.
  • src pr create --private --attach, and src pr comment --attach on a private pull request, upload there too.
  • A person who reads the pull request through a share sees the images and videos that its description and its visible comments show. The share opens no other file of the companion.
  • When you make the pull request public, the forge copies those images and videos to the attachments/ folder of the public repository, and changes their links. Everyone sees them from then on.

Done

Your issue now shows the screenshot or the video, right where you explain the bug.

Attach from a terminal

In a clone, add --attach to src pr create or src pr comment. Give it once for each file:

src pr create --title "Fix the menu on phones" --body "The menu fits now." --attach before.png --attach after.png
src pr comment 7 --body "Fixed, see the video." --attach fix.mp4

You need the same access as in the web editor: you can comment on the repository.

  • Each file goes after your text, in its own paragraph, as the web editor writes it.
  • src checks every file before it uploads one. If a file is missing, has a type that is not in What you can attach, or is too large, src sends nothing.
  • --attach without --body is enough for a comment. With --title, it is enough for a new pull request.
  • With --edit-last, src pr comment puts the files in your newest comment, after its new text.
  • --attach does not work with --web. With --dry-run, src pr create uploads nothing and shows the local paths in the text.

A script or a bot uploads the files over REST. See Upload an attachment.

What you can attach

FileTypesLargest file
ImagePNG, JPEG, GIF, WebP, AVIF, ICO, BMP, SVG10 MiB
VideoMP4, WebM, MOV100 MiB
  • The file goes to the Assets tab of the repository, in the folder attachments/. Its name is the SHA-256 of its bytes.
  • If you attach the same file two times, the repository keeps one file. Both links go to it.
  • The attached files count toward the 10 GiB of assets of the repository.