{"id":18310932,"url":"https://github.com/jimschubert/delete-artifacts","last_synced_at":"2026-02-13T15:52:36.981Z","repository":{"id":57541298,"uuid":"290362571","full_name":"jimschubert/delete-artifacts","owner":"jimschubert","description":"a tool to delete artifacts from GitHub workflows","archived":false,"fork":false,"pushed_at":"2020-08-30T21:24:14.000Z","size":37,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T18:50:48.691Z","etag":null,"topics":["github-actions","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimschubert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"jimschubert","patreon":"jimschubert"}},"created_at":"2020-08-26T01:20:03.000Z","updated_at":"2025-03-07T13:49:48.000Z","dependencies_parsed_at":"2022-09-26T18:30:44.888Z","dependency_job_id":null,"html_url":"https://github.com/jimschubert/delete-artifacts","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"jimschubert/go-cli-template","purl":"pkg:github/jimschubert/delete-artifacts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fdelete-artifacts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fdelete-artifacts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fdelete-artifacts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fdelete-artifacts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimschubert","download_url":"https://codeload.github.com/jimschubert/delete-artifacts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimschubert%2Fdelete-artifacts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264357294,"owners_count":23595576,"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":["github-actions","hacktoberfest"],"created_at":"2024-11-05T16:15:56.604Z","updated_at":"2026-01-31T18:13:45.755Z","avatar_url":"https://github.com/jimschubert.png","language":"Go","funding_links":["https://github.com/sponsors/jimschubert","https://patreon.com/jimschubert"],"categories":[],"sub_categories":[],"readme":"# delete-artifacts\n\nCommand line application to delete artifacts from a GitHub Workflow.\n\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue)](./LICENSE)\n![Go Version](https://img.shields.io/github/go-mod/go-version/jimschubert/delete-artifacts)\n![Go](https://github.com/jimschubert/delete-artifacts/workflows/Build/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jimschubert/delete-artifacts)](https://goreportcard.com/report/github.com/jimschubert/delete-artifacts)\n[![Docker Pulls](https://img.shields.io/docker/pulls/jimschubert/delete-artifacts)](https://hub.docker.com/r/jimschubert/delete-artifacts)\n\u003c!-- [![codecov](https://codecov.io/gh/jimschubert/delete-artifacts/branch/master/graph/badge.svg)](https://codecov.io/gh/jimschubert/delete-artifacts) --\u003e \n\n\nFrom [GitHub Workflow's Documentation](https://docs.github.com/en/actions/configuring-and-managing-workflows/persisting-workflow-data-using-artifacts)\n\n\u003e Artifacts automatically expire after 90 days, but you can always reclaim used GitHub Actions storage by deleting artifacts before they expire on GitHub.\n\nWouldn't it be better if you could do this without manually going through every damn workflow to click delete? With `delete-artifacts`, you can:\n\n* Delete your largest artifacts only\n* Delete your artifacts for a given run\n* Automate deleting your artifacts according to a schedule\n* Avoid unnecessary costs for your private repositories\n\n## Usage\n\n```\nUsage:\n  delete-artifacts [OPTIONS]\n\nApplication Options:\n  -o, --owner=   GitHub Owner/Org name [$GITHUB_ACTOR]\n  -r, --repo=    GitHub Repo name [$GITHUB_REPO]\n  -i, --run-id=  The workflow run id from which to delete artifacts\n      --min=     Minimum size in bytes. Artifacts greater than this size will be deleted. (default: 50000000)\n      --max=     Maximum size in bytes. Artifacts less than this size will be deleted\n  -n, --name=    Artifact name to be deleted\n  -p, --pattern= Regex pattern (POSIX) for matching artifact name to be deleted\n  -a, --active=  Consider artifacts as 'active' within this time frame, and avoid deletion. Duration formatted such as 23h59m.\n      --dry-run  Dry-run that does not perform deletions\n  -v, --version  Display version information\n\nHelp Options:\n  -h, --help     Show this help message\n```\n\n### Examples\n\nFirst, export `GITHUB_TOKEN`, then…\n\n```\n# Delete artifacts between 1B and 3MB for Run 229589570 in jimschubert/delete-artifacts-test\ndelete-artifacts --dry-run --owner=jimschubert --repo=delete-artifacts-test --min=1 --max=3000000 --run-id=229589570\n```\n\n```\n# Delete all artifacts in jimschubert/delete-artifacts-test matching name \"delete_me\"\ndelete-artifacts --dry-run --owner=jimschubert --repo=delete-artifacts-test --name delete_me\n```\n\n```\n# Delete all artifacts in jimschubert/delete-artifacts-test matching a specific regex pattern (ending in .bin), note the escape character\ndelete-artifacts --dry-run --owner=jimschubert --repo=delete-artifacts-test --pattern='\\.bin'\n```\n\n*Remove `--dry-run` from examples to perform your delete*\n\n## Installation\n\nLatest binary releases are available via [GitHub Releases](https://github.com/jimschubert/delete-artifacts/releases).\n\n## Via Docker\n\nPass the required environment variable(s) to Docker and run like so:\n\n```bash\ndocker run -e GITHUB_TOKEN jimschubert/delete-artifacts:latest \\\n    --dry-run --owner=jimschubert --repo=delete-artifacts-test --pattern='\\.bin' --min=0\n```\n\n## Build\n\nBuild a local distribution for evaluation using goreleaser.\n\n```bash\ngoreleaser release --skip-publish --snapshot --rm-dist\n```\n\nThis will create an executable application for your os/architecture under `dist`:\n\n```\ndist\n├── checksums.txt\n├── config.yaml\n├── delete-artifacts_darwin_amd64\n│   └── delete-artifacts\n├── delete-artifacts_linux_386\n│   └── delete-artifacts\n├── delete-artifacts_linux_amd64\n│   └── delete-artifacts\n├── delete-artifacts_linux_arm64\n│   └── delete-artifacts\n├── delete-artifacts_linux_arm_6\n│   └── delete-artifacts\n├── delete-artifacts_v0.0.0-next_Darwin_x86_64.tar.gz\n├── delete-artifacts_v0.0.0-next_Linux_arm64.tar.gz\n├── delete-artifacts_v0.0.0-next_Linux_armv6.tar.gz\n├── delete-artifacts_v0.0.0-next_Linux_i386.tar.gz\n├── delete-artifacts_v0.0.0-next_Linux_x86_64.tar.gz\n├── delete-artifacts_v0.0.0-next_Windows_x86_64.zip\n├── delete-artifacts_windows_amd64\n│   └── delete-artifacts.exe\n└── goreleaserdocker356495573\n```\n\nBuild and execute locally:\n\n* Get dependencies\n```shell\ngo get -d ./...\n```\n* Build\n```shell\ngo build cmd/main.go\n```\n* Run\n```shell\n./main\n```\n\n## Logging\n\nHaving issues? Set `LOG_LEVEL` environment variable to one of `debug`, `info`, `warn`, or `error`.\n\nLog outputs with messages and structured fields. For example:\n\n```text\nINFO[0000] delete-artifacts is checking the repo         owner=jimschubert repo=delete-artifacts-test\nDEBU[0000] Querying artifacts across all workflows.     \nDEBU[0000] Iterating artifact.                           name=artifact.bin size=1048576\nDEBU[0000] MinBytes filter has matched.                  MinBytes=0\nDEBU[0000] Found a set of artifacts for slated deletion.  count=1\nDEBU[0000] Querying artifacts across all workflows.     \nDEBU[0000] Zero artifacts remaining for query.          \nDEBU[0000] Total number of artifacts to delete.          count=1\nINFO[0000] Deleting artifact                             name=artifact.bin size=1048576\nINFO[0000] Run complete.                    \n```\n\n## License\n\nThis project is [licensed](./LICENSE) under Apache 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimschubert%2Fdelete-artifacts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimschubert%2Fdelete-artifacts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimschubert%2Fdelete-artifacts/lists"}