github-sandbox-file-downloader
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub Sandbox File Downloader
GitHub Sandbox 文件下载工具
Skill by ara.so — Daily 2026 Skills collection.
A GitHub Actions-based tool that lets you download files into your repository simply by writing a specially formatted commit message — no CLI, no tokens, no secrets required.
由ara.so开发的Skill —— 2026每日技能合集。
这是一个基于GitHub Actions的工具,只需编写格式特殊的提交消息,即可将文件下载到你的仓库中——无需CLI、无需令牌、无需密钥。
What It Does
功能介绍
github-sandboxdownload:download-zip:- — Fetches each URL and saves files individually to
download:using their original filenames.downloads/ - — Fetches all URLs and bundles them into a single timestamped
download-zip:archive in.zip.downloads/
github-sandboxdownload:download-zip:- —— 获取每个URL对应的文件,并以原始文件名分别保存到
download:目录中。downloads/ - —— 获取所有URL对应的文件,并将它们打包成一个带时间戳的
download-zip:归档文件,保存到.zip目录中。downloads/
Setup
设置步骤
1. Fork the Repository
1. 复刻仓库
Fork maanimis/github-sandbox into your GitHub account.
将maanimis/github-sandbox复刻到你的GitHub账号下。
2. Enable Read/Write Workflow Permissions
2. 启用读写工作流权限
- Go to your forked repo on GitHub
- Navigate to Settings → Actions → General
- Scroll to Workflow permissions
- Select Read and write permissions
- Click Save
No API keys, tokens, or secrets are needed.
- 打开GitHub上你的复刻仓库
- 导航至设置 → Actions → 通用
- 滚动到工作流权限部分
- 选择读写权限
- 点击保存
无需API密钥、令牌或密钥。
Usage
使用方法
Trigger downloads by committing to your repo with a specially formatted commit message.
通过向仓库提交格式特殊的提交消息来触发下载操作。
Via GitHub Web UI
通过GitHub网页界面
- Open any file (e.g., ) in your repo
README.md - Click the pencil icon (✏️) to edit
- Make any minor change (a space, blank line, etc.)
- In the Commit changes box, type your download command
- Select Commit directly to the branch
main - Click Commit changes
- 打开仓库中的任意文件(例如)
README.md - 点击铅笔图标(✏️)进行编辑
- 做任意微小修改(比如添加一个空格、空行等)
- 在提交更改框中输入你的下载命令
- 选择直接提交到分支
main - 点击提交更改
Via Git CLI
通过Git命令行
bash
undefinedbash
undefinedDownload individual files
下载单个文件
git commit --allow-empty -m "download: https://example.com/file.zip"
git commit --allow-empty -m "download: https://example.com/file.zip"
Download multiple files
下载多个文件
git commit --allow-empty -m "download: https://example.com/a.zip https://example.com/b.pdf"
git commit --allow-empty -m "download: https://example.com/a.zip https://example.com/b.pdf"
Download and bundle into a ZIP archive
下载并打包成ZIP归档文件
git commit --allow-empty -m "download-zip: https://example.com/a.zip https://example.com/b.pdf"
git push origin main
---git commit --allow-empty -m "download-zip: https://example.com/a.zip https://example.com/b.pdf"
git push origin main
---Command Reference
命令参考
download:
— Save Files Individually
download:download:
—— 单独保存文件
download:download: URL1 URL2 URL3Examples:
bash
undefineddownload: URL1 URL2 URL3示例:
bash
undefinedSingle file
单个文件
git commit --allow-empty -m "download: https://example.com/dataset.csv"
git commit --allow-empty -m "download: https://example.com/dataset.csv"
Multiple files
多个文件
git commit --allow-empty -m "download: https://example.com/model.bin https://example.com/config.json https://example.com/vocab.txt"
**Output:** Files saved individually to `downloads/` with original filenames:downloads/
dataset.csv
model.bin
config.json
vocab.txt
---git commit --allow-empty -m "download: https://example.com/model.bin https://example.com/config.json https://example.com/vocab.txt"
**输出:** 文件以原始文件名单独保存到`downloads/`目录中:downloads/
dataset.csv
model.bin
config.json
vocab.txt
---download-zip:
— Bundle Into ZIP Archive
download-zip:download-zip:
—— 打包成ZIP归档文件
download-zip:download-zip: URL1 URL2 URL3Examples:
bash
undefineddownload-zip: URL1 URL2 URL3示例:
bash
undefinedSingle file zipped
单个文件打包
git commit --allow-empty -m "download-zip: https://example.com/report.pdf"
git commit --allow-empty -m "download-zip: https://example.com/report.pdf"
Multiple files bundled
多个文件打包
git commit --allow-empty -m "download-zip: https://example.com/a.zip https://example.com/b.pdf https://example.com/c.csv"
**Output:** A single timestamped archive in `downloads/`:downloads/
archive_20260423_153012.zip
---git commit --allow-empty -m "download-zip: https://example.com/a.zip https://example.com/b.pdf https://example.com/c.csv"
**输出:** 一个带时间戳的归档文件保存到`downloads/`目录中:downloads/
archive_20260423_153012.zip
---Command Summary Table
命令汇总表
| Command | URLs | Output |
|---|---|---|
| Single | |
| Multiple | |
| Single | |
| Multiple | |
| 命令 | URL数量 | 输出 |
|---|---|---|
| 单个 | |
| 多个 | |
| 单个 | |
| 多个 | |
How the Workflow Works
工作流原理
The GitHub Actions workflow () operates as follows:
.github/workflows/download.ymlyaml
undefinedGitHub Actions工作流()的运行逻辑如下:
.github/workflows/download.ymlyaml
undefinedConceptual workflow structure
概念性工作流结构
on:
push:
branches: [main]
jobs:
download:
runs-on: ubuntu-latest
steps:
- name: Check commit message for download command
# Parses commit message for "download:" or "download-zip:"
# Extracts URLs from the message
# Downloads files using curl/wget
# Commits results to downloads/ with [skip ci] to prevent loops
Key design details:
- The workflow uses `[skip ci]` in its own commit message to avoid infinite trigger loops.
- If no `download:` or `download-zip:` command is found, the workflow exits without doing anything.
- All output files are committed back to the `downloads/` directory automatically.
---on:
push:
branches: [main]
jobs:
download:
runs-on: ubuntu-latest
steps:
- name: Check commit message for download command
# 解析提交消息中的"download:"或"download-zip:"命令
# 提取消息中的URL
# 使用curl/wget下载文件
# 将结果提交到downloads/目录,并添加[skip ci]以避免循环触发
关键设计细节:
- 工作流在自动提交消息中添加`[skip ci]`,以避免无限触发循环。
- 如果未检测到`download:`或`download-zip:`命令,工作流将直接退出,不执行任何操作。
- 所有输出文件会自动提交回`downloads/`目录。
---Checking Download Results
查看下载结果
- Click the Actions tab in your repository
- Click the latest workflow run to monitor progress and view logs
- After completion, go to the Code tab and open to find your files
downloads/
- 点击仓库中的Actions标签页
- 点击最新的工作流运行记录,监控进度并查看日志
- 完成后,进入Code标签页,打开目录即可找到你的文件
downloads/
Common Patterns
常见使用场景
Downloading a Dataset
下载数据集
bash
git commit --allow-empty -m "download: https://raw.githubusercontent.com/datasets/covid-19/main/data/worldwide-aggregated.csv"
git push origin mainbash
git commit --allow-empty -m "download: https://raw.githubusercontent.com/datasets/covid-19/main/data/worldwide-aggregated.csv"
git push origin mainDownloading Multiple Assets and Archiving
下载多个资源并归档
bash
git commit --allow-empty -m "download-zip: https://example.com/weights.bin https://example.com/tokenizer.json https://example.com/config.yaml"
git push origin mainbash
git commit --allow-empty -m "download-zip: https://example.com/weights.bin https://example.com/tokenizer.json https://example.com/config.yaml"
git push origin mainDownloading a Public GitHub Release Asset
下载GitHub公开发布的资产
bash
git commit --allow-empty -m "download: https://github.com/owner/repo/releases/download/v1.0.0/binary-linux-amd64.tar.gz"
git push origin mainbash
git commit --allow-empty -m "download: https://github.com/owner/repo/releases/download/v1.0.0/binary-linux-amd64.tar.gz"
git push origin mainTroubleshooting
故障排除
Workflow doesn't trigger
工作流未触发
- Confirm Read and write permissions are enabled under Settings → Actions → General → Workflow permissions.
- Make sure you committed directly to the branch (not a PR or other branch, unless the workflow is configured otherwise).
main - Check the Actions tab for any failed or skipped runs.
- 确认设置 → Actions → 通用 → 工作流权限中已启用读写权限。
- 确保你直接提交到了分支(而非PR或其他分支,除非工作流已另行配置)。
main - 查看Actions标签页中是否有失败或跳过的运行记录。
Files not appearing in downloads/
downloads/文件未出现在downloads/
目录中
downloads/- Verify the URLs are publicly accessible — no authentication, login, or VPN required.
- Check workflow logs in the Actions tab for HTTP errors (403, 404, etc.).
- Ensure URLs don't redirect to a login page.
- 验证URL是否可公开访问——无需身份验证、登录或VPN。
- 在Actions标签页中查看工作流日志,检查是否存在HTTP错误(403、404等)。
- 确保URL不会重定向到登录页面。
Workflow runs in an infinite loop
工作流无限循环运行
- This shouldn't happen — the workflow appends to its own commit messages.
[skip ci] - If you've modified the workflow file, verify the tag is still present in the auto-commit step.
[skip ci]
- 这种情况理论上不会发生——工作流会在自动提交消息中添加标签。
[skip ci] - 如果你修改了工作流文件,请确认自动提交步骤中仍包含标签。
[skip ci]
Multiple URLs not downloading
多个URL未下载
- Ensure URLs are separated by spaces only (no commas).
- Avoid special characters in the commit message that might break shell parsing.
bash
undefined- 确保URL之间仅用空格分隔(不要用逗号)。
- 避免在提交消息中使用可能破坏shell解析的特殊字符。
bash
undefined✅ Correct
✅ 正确写法
git commit --allow-empty -m "download: https://example.com/a.zip https://example.com/b.zip"
git commit --allow-empty -m "download: https://example.com/a.zip https://example.com/b.zip"
❌ Incorrect (comma separator)
❌ 错误写法(使用逗号分隔)
git commit --allow-empty -m "download: https://example.com/a.zip, https://example.com/b.zip"
undefinedgit commit --allow-empty -m "download: https://example.com/a.zip, https://example.com/b.zip"
undefinedCommit message not recognized
提交消息未被识别
- The command prefix must be exactly or
download:(lowercase, with colon, followed by a space).download-zip: - The command must appear in the commit message subject line (first line), not the body.
bash
undefined- 命令前缀必须严格为或
download:(小写,带冒号,后跟空格)。download-zip: - 命令必须出现在提交消息主题行(第一行),而非消息正文。
bash
undefined✅ Correct
✅ 正确写法
git commit --allow-empty -m "download: https://example.com/file.zip"
git commit --allow-empty -m "download: https://example.com/file.zip"
❌ Won't trigger (wrong prefix)
❌ 无法触发(前缀错误)
git commit --allow-empty -m "Download: https://example.com/file.zip"
---git commit --allow-empty -m "Download: https://example.com/file.zip"
---Notes & Limitations
注意事项与限制
- Public URLs only — downloads require no authentication.
- GitHub Actions limits apply — workflow execution time, storage, and API rate limits are subject to your GitHub plan.
- Branch — by default, the workflow triggers on pushes to . Check
mainif your default branch differs..github/workflows/ - File size — very large files may hit GitHub repository size limits (typically 100MB per file, 1GB total soft limit).
- 仅支持公开URL——下载无需身份验证。
- 受GitHub Actions限制约束——工作流执行时间、存储空间和API速率限制取决于你的GitHub计划。
- 分支限制——默认情况下,工作流在推送到分支时触发。如果你的默认分支不同,请检查
main目录下的配置文件。.github/workflows/ - 文件大小限制——超大文件可能会触及GitHub仓库大小限制(通常单个文件不超过100MB,总大小软限制为1GB)。