{"id":34948734,"url":"https://github.com/boringcache/action","last_synced_at":"2026-02-26T22:17:58.757Z","repository":{"id":318896598,"uuid":"1049889563","full_name":"boringcache/action","owner":"boringcache","description":"Cache any directory in GitHub Actions. Drop-in replacement for actions/cache.","archived":false,"fork":false,"pushed_at":"2026-02-23T20:47:45.000Z","size":1860,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-24T03:32:31.851Z","etag":null,"topics":["caching","ci","cicd","dependency-management","github-actions","utilities"],"latest_commit_sha":null,"homepage":"https://boringcache.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boringcache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-09-03T16:35:05.000Z","updated_at":"2026-02-23T20:44:56.000Z","dependencies_parsed_at":"2026-02-05T15:00:31.730Z","dependency_job_id":null,"html_url":"https://github.com/boringcache/action","commit_stats":null,"previous_names":["boringcache/action"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/boringcache/action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boringcache%2Faction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boringcache%2Faction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boringcache%2Faction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boringcache%2Faction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boringcache","download_url":"https://codeload.github.com/boringcache/action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boringcache%2Faction/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29874559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T21:05:00.265Z","status":"ssl_error","status_checked_at":"2026-02-26T20:57:13.669Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caching","ci","cicd","dependency-management","github-actions","utilities"],"created_at":"2025-12-26T20:57:29.605Z","updated_at":"2026-02-26T22:17:58.712Z","avatar_url":"https://github.com/boringcache.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# boringcache/action\n\n**Cache once. Reuse everywhere.**\n\nBoringCache is a universal build artifact cache for CI, Docker, and local development. It stores and restores directories you choose so build outputs, dependencies, and tool caches can be reused across environments.\n\nBoringCache does not run builds and is not tied to any build tool. It works with any language, framework, or workflow by caching directories explicitly selected by the user.\n\nCaches are content-addressed and verified before restore. If identical content already exists, uploads are skipped. The same cache can be reused in GitHub Actions, Docker/BuildKit, and on developer machines using the same CLI.\n\nThis action is a drop-in replacement for `actions/cache` that integrates BoringCache into GitHub Actions workflows.\n\n## Quick start\n\n```yaml\n- uses: boringcache/action@v1\n  with:\n    workspace: my-org/my-project\n    entries: deps:node_modules,build:dist\n  env:\n    BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}\n```\n\n## Mental model\n\nThis action caches directories you explicitly choose.\n\n- You decide what is expensive (dependencies, build outputs, toolchains)\n- BoringCache fingerprints the directory contents\n- If the content matches an existing cache, uploads are skipped\n- The same cache can be reused in CI, Docker builds, or locally\n\nThis action does not infer what should be cached and does not modify your build.\n\n## Common patterns\n\n### Simple CI cache\n\n```yaml\n- uses: boringcache/action@v1\n  with:\n    workspace: my-org/my-project\n    entries: deps:node_modules\n  env:\n    BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}\n```\n\n### Advanced pattern: Shared bundle cache (runner + Dockerfile)\n\nThis pattern shows how to reuse the same cache across the GitHub Actions runner and a Docker image build.\n\n```yaml\nname: Docker Build (Shared Bundle Cache)\n\non:\n  push:\n    branches: [main]\n\njobs:\n  build:\n    runs-on: ubuntu-22.04\n    env:\n      BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}\n      BORINGCACHE_WORKSPACE: my-org/my-project\n      BUNDLE_TAG: bundle\n\n    steps:\n      - uses: actions/checkout@v4\n\n      # Atomic cache on the runner (same tag reused in the Dockerfile)\n      - uses: boringcache/action@v1\n        with:\n          workspace: ${{ env.BORINGCACHE_WORKSPACE }}\n          entries: ${{ env.BUNDLE_TAG }}:vendor/bundle\n\n      - run: |\n          bundle config set path vendor/bundle\n          bundle install\n\n      # Whole-image cache + BuildKit layer cache (BoringCache-backed)\n      - uses: boringcache/docker-action@v1\n        with:\n          workspace: ${{ env.BORINGCACHE_WORKSPACE }}\n          image: ghcr.io/${{ github.repository }}\n          tags: latest,${{ github.sha }}\n          build-args: |\n            BORINGCACHE_WORKSPACE=${{ env.BORINGCACHE_WORKSPACE }}\n            BUNDLE_TAG=${{ env.BUNDLE_TAG }}\n          secrets: |\n            id=boringcache_token,env=BORINGCACHE_API_TOKEN\n```\n\n```Dockerfile\n# syntax=docker/dockerfile:1.5\nFROM ubuntu:22.04\n\nARG BORINGCACHE_WORKSPACE\nARG BUNDLE_TAG=bundle\n\n# Install dependencies and Ruby via mise\nRUN apt-get update \u0026\u0026 apt-get install -y curl git build-essential libssl-dev libreadline-dev zlib1g-dev libyaml-dev \u0026\u0026 \\\n    curl https://mise.run | sh \u0026\u0026 \\\n    ~/.local/bin/mise use -g ruby@3.3\n\nENV PATH=\"/root/.local/share/mise/shims:$PATH\"\n\nWORKDIR /app\nCOPY Gemfile Gemfile.lock ./\n\nRUN --mount=type=secret,id=boringcache_token \\\n  export BORINGCACHE_API_TOKEN=\"$(cat /run/secrets/boringcache_token)\" \u0026\u0026 \\\n  curl -sSL https://install.boringcache.com/install.sh | sh \u0026\u0026 \\\n  boringcache restore \"$BORINGCACHE_WORKSPACE\" \"${BUNDLE_TAG}:vendor/bundle\" || true \u0026\u0026 \\\n  bundle config set path vendor/bundle \u0026\u0026 \\\n  bundle install \u0026\u0026 \\\n  boringcache save \"$BORINGCACHE_WORKSPACE\" \"${BUNDLE_TAG}:vendor/bundle\"\n\nCOPY . .\n```\n\n## Inputs\n\n| Input | Required | Default | Description |\n|-------|----------|---------|-------------|\n| `workspace` | No | repo name | Workspace in `org/repo` form. Defaults to `BORINGCACHE_DEFAULT_WORKSPACE` or repo name. |\n| `entries` | No | - | Comma-separated `tag:path` pairs. Required unless using actions/cache-compatible inputs. |\n| `path` | No | - | Files/directories to cache (actions/cache compatible). |\n| `key` | No | - | Cache key (actions/cache compatible). |\n| `restore-keys` | No | - | Fallback restore keys (actions/cache compatible). |\n| `cli-version` | No | `v1.0.2` | BoringCache CLI version. Set to `skip` to disable installation. |\n| `enableCrossOsArchive` | No | `false` | Enable cross-OS sharing by disabling platform suffixes (actions/cache compatibility). |\n| `save-always` | No | `false` | Save even if earlier steps fail. |\n| `no-platform` | No | `false` | Disable OS/arch scoping for cache tags. |\n| `fail-on-cache-miss` | No | `false` | Fail if cache is not found. |\n| `lookup-only` | No | `false` | Check cache existence without downloading. |\n| `force` | No | `false` | Overwrite existing cache on save. |\n| `verbose` | No | `false` | Enable detailed output. |\n| `exclude` | No | - | Glob patterns to exclude (comma-separated, e.g. `*.out,*.log`). |\n\n## Outputs\n\n| Output | Description |\n|--------|-------------|\n| `cache-hit` | `true` if an exact match was found |\n| `cache-primary-key` | Key used for restore |\n| `cache-matched-key` | Key that matched |\n\n## Platform behavior\n\nPlatform scoping is what makes it safe to reuse caches across machines.\n\nBy default, caches are isolated by OS and architecture. Use `no-platform: true` or `enableCrossOsArchive: true` only for portable artifacts (sources, lockfiles).\n\n## Environment variables\n\n| Variable | Description |\n|----------|-------------|\n| `BORINGCACHE_API_TOKEN` | API token (required) |\n| `BORINGCACHE_DEFAULT_WORKSPACE` | Default workspace (if not specified in inputs) |\n\n## Migrating from actions/cache (optional)\n\n```diff\n- uses: actions/cache@v4\n+ uses: boringcache/action@v1\n+ env:\n+   BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}\n```\n\nIf you already use `path`, `key`, and `restore-keys`, those inputs are supported as-is.\n\n```yaml\n- uses: boringcache/action@v1\n  with:\n    path: node_modules\n    key: node-deps-${{ hashFiles('package-lock.json') }}\n    restore-keys: |\n      node-deps-\n  env:\n    BORINGCACHE_API_TOKEN: ${{ secrets.BORINGCACHE_API_TOKEN }}\n```\n\n## Troubleshooting\n\n- Unauthorized or workspace not found: ensure `BORINGCACHE_API_TOKEN` is set and the workspace exists.\n- Cache miss: check `workspace` and `entries`, and remember platform scoping.\n- Cache hit detection: rely on the `cache-hit` output rather than CLI exit codes.\n\n## Release notes\n\nSee https://github.com/boringcache/action/releases.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboringcache%2Faction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboringcache%2Faction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboringcache%2Faction/lists"}