shunk031-github-comment-attach-files

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
[!NOTE] After reading this
SKILL.md
, say:
📎 I read shunk031-github-comment-attach-files.
[!NOTE] 阅读此
SKILL.md
后,请说:
📎 I read shunk031-github-comment-attach-files.

GitHub Attach Files

GitHub 附加文件

Use this skill to attach supported media (images and videos) to GitHub pull request descriptions or issue and pull request comments on GitHub.com and GHE.com. This route does not support document uploads or GitHub Enterprise Server.
Check the installed CLI with
gh pr edit --help
and
gh issue comment --help
; the installed CLI is the authority for media attachment support and flags.
使用此 skill 可将支持的媒体(图片和视频)附加到 GitHub.com 和 GHE.com 上的 GitHub pull request 描述,或 issue 和 pull request 评论中。此方式不支持文档上传,也不支持 GitHub Enterprise Server。
使用
gh pr edit --help
和
gh issue comment --help
检查已安装的 CLI;是否支持媒体附件以及有哪些可用参数,应以已安装的 CLI 为准。

Pull request descriptions

Pull request 描述

Use
gh pr edit <pr> --attach file#alt
to upload supported media and write its Markdown into a pull request description:
bash
gh pr edit 123 \
  --attach "results/before.png#With mathclap" \
  --attach "results/after.png#Without mathclap"
If the body does not reference an attached media file,
gh pr edit
appends the attachment Markdown to the description. Include explicit image or video references in the body when their position or surrounding explanation matters.
使用
gh pr edit <pr> --attach file#alt
上传支持的媒体,并将其 Markdown 写入 pull request 描述:
bash
gh pr edit 123 \
  --attach "results/before.png#With mathclap" \
  --attach "results/after.png#Without mathclap"
如果正文未引用已附加的媒体文件,
gh pr edit
会将附件 Markdown 追加到描述末尾。当媒体的位置或上下文说明很重要时,请在正文中显式引用图片或视频。

Issue and pull request comments

Issue 和 pull request 评论

Use
gh issue comment <number-or-url> --attach file#alt
when supported media belongs in a submitted issue or pull request comment:
bash
gh issue comment 123 \
  --body 'Rendered comparison:' \
  --attach "results/before.png#Before" \
  --attach "results/after.png#After"
The CLI workflows mutate GitHub immediately; confirm the target and requested write before running them.
当需要在提交的 issue 或 pull request 评论中添加支持的媒体时,使用
gh issue comment <number-or-url> --attach file#alt
:
bash
gh issue comment 123 \
  --body 'Rendered comparison:' \
  --attach "results/before.png#Before" \
  --attach "results/after.png#After"
这些 CLI 工作流会立即修改 GitHub 上的内容;运行前请确认目标对象和要执行的写入操作。

Prerequisites

前置条件

  • gh
    must be installed and authenticated.
  • If the CLI does not expose
    --attach
    , report that the installed version does not support direct attachments.
  • 必须已安装并认证
    gh
    。
  • 如果 CLI 未提供
    --attach
    ,请说明已安装的版本不支持直接附加附件。