{"id":26167453,"url":"https://github.com/yanovation/delete-old-actions","last_synced_at":"2025-09-10T06:34:23.206Z","repository":{"id":280114316,"uuid":"941025010","full_name":"yanovation/delete-old-actions","owner":"yanovation","description":"Deletes old Github Actions","archived":false,"fork":false,"pushed_at":"2025-07-23T03:53:58.000Z","size":658,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-23T05:25:49.742Z","etag":null,"topics":["clean","cleaner","github","github-actions","history-management"],"latest_commit_sha":null,"homepage":"https://pooyan.info","language":"TypeScript","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/yanovation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-01T09:53:44.000Z","updated_at":"2025-07-23T03:52:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"d491a5bb-0374-4901-8926-c6264b336710","html_url":"https://github.com/yanovation/delete-old-actions","commit_stats":null,"previous_names":["yanovation/delete-old-actions"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/yanovation/delete-old-actions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanovation%2Fdelete-old-actions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanovation%2Fdelete-old-actions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanovation%2Fdelete-old-actions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanovation%2Fdelete-old-actions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yanovation","download_url":"https://codeload.github.com/yanovation/delete-old-actions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yanovation%2Fdelete-old-actions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274422255,"owners_count":25282123,"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","status":"online","status_checked_at":"2025-09-10T02:00:12.551Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["clean","cleaner","github","github-actions","history-management"],"created_at":"2025-03-11T17:36:58.784Z","updated_at":"2025-09-10T06:34:23.191Z","avatar_url":"https://github.com/yanovation.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n[![License](https://img.shields.io/github/license/yanovation/delete-old-actions?color=blue\u0026label=License\u0026style=flat-square)](https://github.com/yanovation/delete-old-actions/blob/main/LICENSE.md)\n[![Last commit](https://img.shields.io/github/last-commit/yanovation/delete-old-actions.svg?color=blue\u0026style=flat-square)](https://github.com/yanovation/delete-old-actions/commits/main)\n[![Contributors](https://img.shields.io/github/contributors/yanovation/delete-old-actions?color=blue\u0026style=flat-square)](https://github.com/yanovation/delete-old-actions/graphs/contributors)\n\u003c/div\u003e\n\n# About\n\nRemoves old GitHub Actions runs to keep your repository clean.\nYou are advised to run this action with the dry-run option first to see what will be deleted.  \nWhen you are ready to use this, you can schedule it to check periodically.\n\n**WARNING: Deletion cannot be undone. Use at your own risk.**\n\n## Usage\n\n```yaml\non:\n  schedule:\n    - cron: '0 0 * * *'  # Specify your own schedule\n\njobs:\n  delete-old-actions:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: yanovation/delete-old-actions@v1\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          days-ago: 30\n```\n\nOr you can test with dry-run option:\n\n```yaml\non:\n  schedule:\n    - cron: '0 0 * * *'\n\njobs:\n  delete-old-actions:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: yanovation/delete-old-actions@v1\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          days-ago: 30\n          dry-run: true \n```\n\nYou can also keep the last N runs (N = 5 in this example):\n\n```yaml\non:\n  schedule:\n    - cron: '0 0 * * *'\n\njobs:\n  delete-old-actions:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: yanovation/delete-old-actions@v1\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          days-ago: 30\n          dry-run: true\n          keep-latest: 5\n```\n\n## Options\n\n* `token`: The GitHub token to use for authentication. (**required**)\n* `days-ago`: The number of days ago to delete the runs. (**required**)\n* `dry-run`: If set to true, the Action will only list the runs to be deleted without actually deleting them. (**optional**,\n  default: false, meaning it will delete the runs)\n* `keep-latest`: The number of latest runs to keep. (**optional**, default: 0, meaning this option is disabled)\n\nFor the token, you can just use the `{{ secrets.GITHUB_TOKEN }}` which is a default secret that GitHub provides to each\nrun. You can read more about\nit [here](https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication).\n\n## Token permissions\nIf you want to use the default `${{ secrets.GITHUB_TOKEN }}`, you should give it a write permissions either on the \nrepository or organization level:  \n![How to give default write access to GITHUB_TOKEN](/_docs/img/github-token-permission.png)  \nYou can read more about it [here](https://docs.github.com/en/actions/security-guides/automatic-token-authentication).  \nThis is **the easiest way**, especially if you have multiple repositories within multiple organizations and have access to \nupdate this setting, but **gives too much access to the token**.\n\nAlternatively, you can authenticate with a GitHub App (needs more setup):\n```yaml\n...\n    steps:\n      - name: Generate a token\n        id: generate-token\n        uses: actions/create-github-app-token@v1\n        with:\n          app-id: ${{ vars.APP_ID }}\n          private-key: ${{ secrets.APP_PRIVATE_KEY }}\n\n      - uses: yanovation/delete-old-actions@v1\n        with:\n          token: ${{ steps.generate-token.outputs.token }}\n          days-ago: 30\n```\nYou can read more about it [here](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow#authenticating-with-a-github-app).\n\nAlso, another option is to create a [Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).\nMake sure to give the token the least needed access.\n\n## Other docs\n\n- [How to release](./_docs/release.md)\n- [How to contribute](./CONTRIBUTING.md)\n- [License](./LICENSE.md)\n- [Change log](./CHANGELOG.md)\n\n## Articles (to learn more about it)\n- [Automatically delete old GitHub Actions runs](https://pooyan.info/articles/delete-old-github-actions-runs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanovation%2Fdelete-old-actions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyanovation%2Fdelete-old-actions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyanovation%2Fdelete-old-actions/lists"}