{"id":14985894,"url":"https://github.com/bd103/cargo-sweep","last_synced_at":"2026-02-28T09:32:21.665Z","repository":{"id":252099907,"uuid":"839406056","full_name":"BD103/cargo-sweep","owner":"BD103","description":"Remove stale build artifacts from your Cargo caches in Github Actions!","archived":false,"fork":false,"pushed_at":"2025-02-04T22:26:24.000Z","size":7166,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T22:11:58.801Z","etag":null,"topics":["actions","cache","cargo","rust"],"latest_commit_sha":null,"homepage":"","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/BD103.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}},"created_at":"2024-08-07T14:42:11.000Z","updated_at":"2025-03-28T23:41:59.000Z","dependencies_parsed_at":"2024-09-10T14:33:54.269Z","dependency_job_id":"a5935906-2442-4126-801c-3a3340a65d95","html_url":"https://github.com/BD103/cargo-sweep","commit_stats":{"total_commits":55,"total_committers":1,"mean_commits":55.0,"dds":0.0,"last_synced_commit":"ad5ba9ef189020714781e08c7176a9efca9bd272"},"previous_names":["bd103/cargo-sweep"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BD103%2Fcargo-sweep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BD103%2Fcargo-sweep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BD103%2Fcargo-sweep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BD103%2Fcargo-sweep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BD103","download_url":"https://codeload.github.com/BD103/cargo-sweep/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487689,"owners_count":21112190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["actions","cache","cargo","rust"],"created_at":"2024-09-24T14:11:50.738Z","updated_at":"2026-02-28T09:32:21.629Z","avatar_url":"https://github.com/BD103.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `cargo-sweep` action\n\nThis action cleans up stale build files from the `target` directory of Rust projects. It can be used to delete files that are never accessed between when this action runs and the end of the job.\n\n\u003e [!NOTE]\n\u003e\n\u003e This action originally leveraged [`cargo-sweep`](https://github.com/holmgr/cargo-sweep) to\n\u003e implement its logic, but has since transitioned to a faster, pure-Javascript approach. The name\n\u003e has been kept for historical reasons, but `cargo-sweep` is no longer installed when running this\n\u003e action.\n\n## When would you use this?\n\nThis is most useful if you cache the `target` directory and use `restore-keys` to fallback on old caches. In these specific examples, old artifacts tend to pile up over time, causing caches to grow to gigabytes in size. You can use `cargo-sweep` to prune these old artifacts while keeping the current ones.\n\n## Quickstart\n\n```yml\n# Rust (and Cargo) must be installed in order to use `cargo-sweep`.\n- name: Install Rust\n  uses: dtolnay/rust-toolchain@stable\n\n# Make sure to restore your cache before calling `cargo-sweep`.\n- name: Cache build files\n  uses: actions/cache@v4\n  with:\n    # You probably want to cache more files and use a more-detailed key. This is kept short for\n    # brevity's sake.\n    path: target\n    key: my-job-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}\n    # `cargo-sweep` is only useful if you use restore keys.\n    restore-keys: my-job-${{ runner.os }}-\n\n- name: Sweep cache for stale files\n  uses: BD103/cargo-sweep@v2\n\n# Any artifacts used between `cargo-sweep` and the end of the job will be kept, the rest will be\n# discarded.\n- run: cargo build\n```\n\n\u003e [!TIP]\n\u003e\n\u003e For an all-in-one caching and sweeping solution, I highly recommend [Leafwing-Studios/cargo-cache](https://github.com/Leafwing-Studios/cargo-cache), which integrates with this action directly!\n\n## Inputs\n\n```yml\n- name: Sweep cache for stale files\n  uses: BD103/cargo-sweep@v2\n  with:\n    # The path to `Cargo.toml`, used to discover the Cargo workspace and `target` directory. By\n    # default this is the `Cargo.toml` in the current working directory.\n    manifest-path: Cargo.toml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbd103%2Fcargo-sweep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbd103%2Fcargo-sweep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbd103%2Fcargo-sweep/lists"}