github-sandbox-file-downloader

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitHub 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-sandbox
listens for commit messages containing
download:
or
download-zip:
commands. When detected, a GitHub Actions workflow runs and:
  • download:
    — Fetches each URL and saves files individually to
    downloads/
    using their original filenames.
  • download-zip:
    — Fetches all URLs and bundles them into a single timestamped
    .zip
    archive in
    downloads/
    .

github-sandbox
会监听包含
download:
download-zip:
命令的提交消息。当检测到这些命令时,GitHub Actions工作流会启动并执行以下操作:
  • download:
    —— 获取每个URL对应的文件,并以原始文件名分别保存到
    downloads/
    目录中。
  • download-zip:
    —— 获取所有URL对应的文件,并将它们打包成一个带时间戳的
    .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. 启用读写工作流权限

  1. Go to your forked repo on GitHub
  2. Navigate to Settings → Actions → General
  3. Scroll to Workflow permissions
  4. Select Read and write permissions
  5. Click Save
No API keys, tokens, or secrets are needed.

  1. 打开GitHub上你的复刻仓库
  2. 导航至设置 → Actions → 通用
  3. 滚动到工作流权限部分
  4. 选择读写权限
  5. 点击保存
无需API密钥、令牌或密钥。

Usage

使用方法

Trigger downloads by committing to your repo with a specially formatted commit message.
通过向仓库提交格式特殊的提交消息来触发下载操作。

Via GitHub Web UI

通过GitHub网页界面

  1. Open any file (e.g.,
    README.md
    ) in your repo
  2. Click the pencil icon (✏️) to edit
  3. Make any minor change (a space, blank line, etc.)
  4. In the Commit changes box, type your download command
  5. Select Commit directly to the
    main
    branch
  6. Click Commit changes
  1. 打开仓库中的任意文件(例如
    README.md
  2. 点击铅笔图标(✏️)进行编辑
  3. 做任意微小修改(比如添加一个空格、空行等)
  4. 提交更改框中输入你的下载命令
  5. 选择直接提交到
    main
    分支
  6. 点击提交更改

Via Git CLI

通过Git命令行

bash
undefined
bash
undefined

Download 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: URL1 URL2 URL3
Examples:
bash
undefined
download: URL1 URL2 URL3
示例:
bash
undefined

Single 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

多个文件


**Output:** Files saved individually to `downloads/` with original filenames:
downloads/ dataset.csv model.bin config.json vocab.txt

---

**输出:** 文件以原始文件名单独保存到`downloads/`目录中:
downloads/ dataset.csv model.bin config.json vocab.txt

---

download-zip:
— Bundle Into ZIP Archive

download-zip:
—— 打包成ZIP归档文件

download-zip: URL1 URL2 URL3
Examples:
bash
undefined
download-zip: URL1 URL2 URL3
示例:
bash
undefined

Single 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

多个文件打包


**Output:** A single timestamped archive in `downloads/`:
downloads/ archive_20260423_153012.zip

---

**输出:** 一个带时间戳的归档文件保存到`downloads/`目录中:
downloads/ archive_20260423_153012.zip

---

Command Summary Table

命令汇总表

CommandURLsOutput
download: URL
Single
downloads/filename.ext
download: URL1 URL2
Multiple
downloads/file1.ext
,
downloads/file2.ext
download-zip: URL
Single
downloads/archive_YYYYMMDD_HHMMSS.zip
download-zip: URL1 URL2
Multiple
downloads/archive_YYYYMMDD_HHMMSS.zip
(all bundled)

命令URL数量输出
download: URL
单个
downloads/filename.ext
download: URL1 URL2
多个
downloads/file1.ext
,
downloads/file2.ext
download-zip: URL
单个
downloads/archive_YYYYMMDD_HHMMSS.zip
download-zip: URL1 URL2
多个
downloads/archive_YYYYMMDD_HHMMSS.zip
(所有文件打包)

How the Workflow Works

工作流原理

The GitHub Actions workflow (
.github/workflows/download.yml
) operates as follows:
yaml
undefined
GitHub Actions工作流(
.github/workflows/download.yml
)的运行逻辑如下:
yaml
undefined

Conceptual 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

查看下载结果

  1. Click the Actions tab in your repository
  2. Click the latest workflow run to monitor progress and view logs
  3. After completion, go to the Code tab and open
    downloads/
    to find your files

  1. 点击仓库中的Actions标签页
  2. 点击最新的工作流运行记录,监控进度并查看日志
  3. 完成后,进入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 main
bash
git commit --allow-empty -m "download: https://raw.githubusercontent.com/datasets/covid-19/main/data/worldwide-aggregated.csv"
git push origin main

Downloading 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 main
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 main

Downloading 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 main

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 main

Troubleshooting

故障排除

Workflow doesn't trigger

工作流未触发

  • Confirm Read and write permissions are enabled under Settings → Actions → General → Workflow permissions.
  • Make sure you committed directly to the
    main
    branch (not a PR or other branch, unless the workflow is configured otherwise).
  • Check the Actions tab for any failed or skipped runs.
  • 确认设置 → Actions → 通用 → 工作流权限中已启用读写权限
  • 确保你直接提交到了
    main
    分支(而非PR或其他分支,除非工作流已另行配置)。
  • 查看Actions标签页中是否有失败或跳过的运行记录。

Files not appearing in
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
    [skip ci]
    to its own commit messages.
  • If you've modified the workflow file, verify the
    [skip ci]
    tag is still present in the auto-commit step.
  • 这种情况理论上不会发生——工作流会在自动提交消息中添加
    [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"
undefined
git commit --allow-empty -m "download: https://example.com/a.zip, https://example.com/b.zip"
undefined

Commit message not recognized

提交消息未被识别

  • The command prefix must be exactly
    download:
    or
    download-zip:
    (lowercase, with colon, followed by a space).
  • 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
    main
    . Check
    .github/workflows/
    if your default branch differs.
  • 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)。