No description
  • JavaScript 91.4%
  • Shell 5.8%
  • Makefile 2.8%
Find a file
Stephen Way e4113b37c0
All checks were successful
test / unit (push) Successful in 26s
test / e2e (push) Successful in 26s
Add Forgejo-compatible download-artifact action
Port of actions/download-artifact for Forgejo runners with no GitHub artifact
API. node20 action run from source (zero npm deps) that fetches named
artifacts from S3-compatible or filesystem storage written by
upload-artifact-action, reusing cache-action's storage layer.

- Same with: surface as download-artifact@v4 (name, path, pattern,
  merge-multiple, run-id, repository) plus download-path output.
- Download by name, all-for-run into per-name dirs, name patterns,
  merge-multiple, and cross-run / cross-repo via the metadata sidecar.
- Offline test suite and a Forgejo e2e workflow; README, migration, examples.
2026-05-28 09:05:28 -07:00
.forgejo Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
.githooks Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
examples/workflows Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
scripts Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
src Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
tests Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
.editorconfig Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
.gitignore Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
action.yml Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
CHANGELOG.md Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
CONTRIBUTING.md Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
LICENSE Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
Makefile Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
MIGRATION.md Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
package.json Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
README.md Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00
SECURITY.md Add Forgejo-compatible download-artifact action 2026-05-28 09:05:28 -07:00

download-artifact-action

test

Download named build artifacts on Forgejo Actions runners from storage you control (S3-compatible or a directory), with no dependency on the GitHub artifact API or github.com. A drop-in port of actions/download-artifact.

Reads what rasterstate/upload-artifact-action writes. Same backend env (RASTER_ARTIFACTS_*).

Quick start

jobs:
  deploy:
    needs: build
    runs-on: [self-hosted, Linux]
    env:
      RASTER_ARTIFACTS_S3_BUCKET: ci-artifacts
      RASTER_ARTIFACTS_S3_ENDPOINT: https://fsn1.your-objectstorage.com
      RASTER_ARTIFACTS_S3_REGION: fsn1
      RASTER_ARTIFACTS_S3_ACCESS_KEY_ID: ${{ secrets.ARTIFACTS_KEY_ID }}
      RASTER_ARTIFACTS_S3_SECRET_ACCESS_KEY: ${{ secrets.ARTIFACTS_SECRET }}
    steps:
      - uses: https://rasterhub.com/rasterstate/download-artifact-action@v1
        with:
          name: dist
          path: build
      - run: ./deploy.sh build

Download every artifact for the run (one subdirectory per name):

- uses: https://rasterhub.com/rasterstate/download-artifact-action@v1
  with:
    path: artifacts

Inputs

Mirror actions/download-artifact@v4.

Input Required Default Description
name no Artifact to download. If omitted, all artifacts for the run.
path no workspace Destination directory.
pattern no Glob over artifact names when downloading multiple.
merge-multiple no false Extract all into path instead of per-name subdirectories.
run-id no current run Download from another workflow run.
repository no current repo Download from another repository (needs backend access to that scope).

Outputs

Output Description
download-path Absolute path where artifacts were extracted.

Behavior

  • A named download extracts directly into path.
  • Downloading all artifacts extracts each into path/<name> (or all into path with merge-multiple).
  • A named artifact that is not found is a hard error. A pattern that matches nothing is a warning.
  • The action reads the JSON metadata sidecar written on upload to find each artifact's object and compression method, so a runner without zstd can still tell when an archive needs it.

Backend configuration

Identical to the upload action: RASTER_ARTIFACTS_* (or AWS_* for credentials). See the upload action README for the full table. Point both at the same bucket and prefix.

Examples

See examples/workflows: consume in a dependent job, download all, matrix, and cross-run.

Migrating from actions/download-artifact

See MIGRATION.md.

License

MIT. See LICENSE.