{"id":24956682,"url":"https://github.com/doodlescheduling/gh-package-retention","last_synced_at":"2025-03-28T20:37:41.856Z","repository":{"id":152800538,"uuid":"626970691","full_name":"DoodleScheduling/gh-package-retention","owner":"DoodleScheduling","description":"Package rentention github action and cli extension for ghcr.io","archived":false,"fork":false,"pushed_at":"2025-03-11T11:57:37.000Z","size":133,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-11T12:36:39.659Z","etag":null,"topics":["cleanup","ghcr","github-action","github-extension","github-packages","package-retention","retention"],"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/DoodleScheduling.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-12T14:20:27.000Z","updated_at":"2023-09-15T13:04:14.000Z","dependencies_parsed_at":"2024-02-20T11:25:34.857Z","dependency_job_id":"f0679788-e1ec-41d7-98bb-4282eb726214","html_url":"https://github.com/DoodleScheduling/gh-package-retention","commit_stats":null,"previous_names":["doodlescheduling/gh-package-retention","doodlescheduling/package-retention"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoodleScheduling%2Fgh-package-retention","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoodleScheduling%2Fgh-package-retention/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoodleScheduling%2Fgh-package-retention/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DoodleScheduling%2Fgh-package-retention/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DoodleScheduling","download_url":"https://codeload.github.com/DoodleScheduling/gh-package-retention/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246100345,"owners_count":20723466,"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":["cleanup","ghcr","github-action","github-extension","github-packages","package-retention","retention"],"created_at":"2025-02-03T06:40:44.886Z","updated_at":"2025-03-28T20:37:41.833Z","avatar_url":"https://github.com/DoodleScheduling.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## ghcr.io package retention\n\n[![release](https://img.shields.io/github/release/DoodleScheduling/gh-package-retention/all.svg)](https://github.com/DoodleScheduling/gh-package-retention/releases)\n[![release](https://github.com/doodlescheduling/package-retention/actions/workflows/release.yaml/badge.svg)](https://github.com/doodlescheduling/package-retention/actions/workflows/release.yaml)\n[![report](https://goreportcard.com/badge/github.com/DoodleScheduling/gh-package-retention)](https://goreportcard.com/report/github.com/DoodleScheduling/gh-package-retention)\n[![Coverage Status](https://coveralls.io/repos/github/DoodleScheduling/gh-package-retention/badge.svg?branch=master)](https://coveralls.io/github/DoodleScheduling/gh-package-retention?branch=master)\n[![license](https://img.shields.io/github/license/DoodleScheduling/gh-package-retention.svg)](https://github.com/DoodleScheduling/gh-package-retention/blob/master/LICENSE)\n\nPackage retention manager for ghcr.io.\nUnlike other apps implementing a similar mechanism this one actually has support for docker manifests\nand can do retentions for multi platform image tags.\n\n* Delete packages based on age (and optionally in combination with a regex filter)\n* Supports rentention for multi platform container images (and all other package types)\n\n## Usage\n\nThis example will remove package versions older than 3000h from the maven repositories package and anotherpackage:\n\n```\npackage-retention --org-name githuborgname --package-type maven --age 3000h package anotherpackage\n```\n\n## Installation\n\n### Brew\n```\nbrew tap doodlescheduling/gh-package-retention\nbrew install gh-package-retention\n```\n\n### Docker\n```\ndocker pull ghcr.io/doodlescheduling/gh-package-retention:v2\n```\n\n### Github cli extenion\n```\ngh extension install DoodleScheduling/gh-package-retention\n```\n\n## Arguments\n\n| Flag  | Env | Default | Description |\n| ------------- | ------------- | ------------- | ------------- |\n| ``  | `PACKAGES`  | `` | **REQUIRED**: One or more paths comma separated to kustomize |\n| `--package-type` | `PACKAGE_TYPE` | `` | **REQUIRED**: Type of package (container, maven, ...) |\n| `--org-name` | `ORG_NAME` | `` | **REQUIRED**: Github organization name which is the package owner |\n| `--age`  | `AGE`  | `` | Max age of a package version. Package versions older than the specified age will be removed (As long as version-match macthes the version). |\n| `--yes`  | `YES` | `false` | Delete packages. By default retention-package runs in a dry mode. |\n| `--log-encoding`  | `LOG_ENCODING` | `console` | Log encoding format. Can be 'json' or 'console'. (default \"console\") |\n| `--log-level`  | `LOG_LEVEL`  | `info` | Log verbosity level. Can be one of 'trace', 'debug', 'info', 'error'. (default \"info\") |\n| `--token`  | `GITHUB_TOKEN` | `1.27.0` | Github token (By default GITHUB_TOKEN will be used) |\n| `--version-match`  | `VERSION_MATCH` | `` | Regex to match a version. Note for containers it will match container tags (If package-type is container)' |\n\n\n## Github Action\n\nThis app works also great on CI, in fact this was the original reason why it was created.\n\n### Example usage\n\n\n```yaml\nname: package-retention\non:\n  schedule:\n    - cron: '0 0 * * *'\njobs:\n  package-retention:\n    permissions:\n      packages: write\n    runs-on: ubuntu-latest\n    steps:\n      - uses: docker://ghcr.io/doodlescheduling/gh-package-retention@sha256:bc6b277986d5a8d0a1c2f67f148cf66bfb40710d6f557b355bf02016bdfdb57c # v2.0.1\n        name: Delete oci helm charts older than 90 days\n        env:\n          PACKAGES: charts/${{ github.event.repository.name }}\n          PACKAGE_TYPE: container\n          AGE: 2160h\n          VERSION_MATCH: 0.0.0-.*\n      - uses: docker://ghcr.io/doodlescheduling/gh-package-retention@sha256:bc6b277986d5a8d0a1c2f67f148cf66bfb40710d6f557b355bf02016bdfdb57c # v2.0.1\n        name: Delete maven snapshot versions older than 90 days\n        with:\n          PACKAGES: org.example.mypackage\n          PACKAGE_TYPE: maven\n          AGE: 2160h\n          VERSION_MATCH: \".*-SNAPSHOT$\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoodlescheduling%2Fgh-package-retention","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoodlescheduling%2Fgh-package-retention","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoodlescheduling%2Fgh-package-retention/lists"}