gh-comment-attach-files
Attach local files to a GitHub issue or pull request comment via Playwright CLI and return the hosted attachment URLs without submitting the comment. Use when you need GitHub-hosted image or document URLs on github.com or GitHub Enterprise Server.
- License 许可
- MIT
- 所属仓库
- mryfmo/dotfiles
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- gh-comment-attach-files
- description
- Attach local files to a GitHub issue or pull request comment via Playwright CLI and return the hosted attachment URLs without submitting the comment. Use when you need GitHub-hosted image or document URLs on github.com or GitHub Enterprise Server.
02 资源文件 2
- 参考文档agents/openai.yaml281 B
- 脚本scripts/executable_attach_comment_files.py19.8 KB
03 SKILL.md 正文
GitHub Comment Attach Files
Read Acknowledgement
- After reading this skill, say:
🐙 私は gh-comment-attach-files を読みました。
When To Use
Use this skill when you need GitHub to host local files and give back anonymized attachment URLs, but the agent must not submit the issue or pull request comment itself.
Typical cases:
- Upload PNG, JPG, PDF, Markdown, or other GitHub-supported attachments to a PR or issue comment box.
- Replace broken local image URLs in a draft report with GitHub-hosted URLs.
- Work against either
github.comor GitHub Enterprise Server.
Do not use this skill when the task is to actually post, edit, or rewrite a comment. This skill stops after URL acquisition.
Prerequisites
npx @playwright/climust be available.- If you use
--repo ... --issue ...or--repo ... --pr ...,ghmust be installed and authenticated. - If GitHub redirects to login or SSO, finish authentication in the opened browser window while the script is polling for the comment composer.
Workflow
- Resolve the target page from either a direct URL or
ghmetadata. - Stage the requested files under
./.playwright-cli/gh-comment-attach-files/.... - Open the issue or pull request page with a persistent Playwright CLI browser profile.
- Find the main comment composer and attach files one by one.
- Read the inserted Markdown and return JSON with
target_url,source_path,staged_name, andattachment_url. - Close the browser unless
--leave-openis used.
Command
Run the command from the project directory so file arguments and ./.playwright-cli/ resolve there; the script is called by its installed path.
Direct URL:
uv run --no-project ~/.agents/skills/gh-comment-attach-files/scripts/attach_comment_files.py \
--url https://github.com/OWNER/REPO/pull/123 \
docs/report.md assets/chart.png
Resolve the page with gh:
uv run --no-project ~/.agents/skills/gh-comment-attach-files/scripts/attach_comment_files.py \
--repo github.example.com/OWNER/REPO \
--pr 123 \
results/report.md results/chart.png
Output
The script prints JSON only:
{
"target_url": "https://github.com/OWNER/REPO/pull/123",
"attachments": [
{
"source_path": "/abs/path/results/chart.png",
"staged_name": "chart--e5b6d4a1.png",
"attachment_url": "https://github.com/user-attachments/assets/..."
}
]
}
Notes
- The script does not submit the comment.
staged_namemay differ from the original basename so duplicate filenames stay distinct.- The default persistent profile lives under
./.playwright-cli/gh-comment-attach-files/profile. - Use
--leave-openwhen you want to keep the browser and draft comment visible after the URLs are collected.
Resources
scripts/
scripts/attach_comment_files.py: resolves the target page, stages files, drives Playwright CLI, and returns hosted attachment URLs as JSON.
04 同仓库更多 Skills
x
暂无简介
y
暂无简介
status-report
Generate a status report with KPIs, risks, and action items. Use when writing a weekly or monthly update for leadership, summarizing project health with green/yellow/red status, surfacing risks and decisions that need stakeholder attention, or turning a pile of project tracker activity into a readable narrative.
runbook
Create or update an operational runbook for a recurring task or procedure. Use when documenting a task that on-call or ops needs to run repeatably, turning tribal knowledge into exact step-by-step commands, adding troubleshooting and rollback steps to an existing procedure, or writing escalation paths for when things go wrong.
risk-assessment
Identify, assess, and mitigate operational risks. Trigger with "what are the risks", "risk assessment", "risk register", "what could go wrong", or when the user is evaluating risks associated with a project, vendor, process, or decision.
change-request
Create a change management request with impact analysis and rollback plan. Use when proposing a system or process change that needs approval, preparing a change record for CAB review, documenting risk and rollback steps before a deployment, or planning stakeholder communications for a rollout.