Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/duskmoon314/action-delete-ghcr-untagged
https://github.com/duskmoon314/action-delete-ghcr-untagged
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/duskmoon314/action-delete-ghcr-untagged
- Owner: duskmoon314
- License: mit
- Created: 2022-10-10T01:45:49.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-18T12:04:23.000Z (over 1 year ago)
- Last Synced: 2024-12-01T07:21:41.837Z (22 days ago)
- Language: TypeScript
- Size: 443 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
[![build-test](https://github.com/duskmoon314/action-delete-ghcr-untagged/actions/workflows/test.yml/badge.svg)](https://github.com/duskmoon314/action-delete-ghcr-untagged/actions/workflows/test.yml)
# Action Delete GHCR Untagged
This action deletes all untagged versions that have exceeded the expiration date from GitHub Container Registry.
## Usage
```yaml
steps:
- uses: duskmoon314/action-delete-ghcr-untagged@v1
with:
# Personal access token with `delete:packages` scope.
# Required.
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}# Owner type of the package. Can be `user` or `org`.
# Default: `user`
owner_type: user# Owner of the package. Can be a username or an organization name.
# Default: `github.repository_owner`
owner: ${{ github.repository_owner }}# Name of the package.
# Required.
package_name: my-package# Expiration date of the untagged versions.
# Default: `30` (days)
expiration: 30
```You can find a real-world example in [duskmoon314/LoD-frontend](https://github.com/duskmoon314/LoD-frontend/blob/main/.github/workflows/docker.yaml#L45-L53)
## Known Limitations
GitHub's API has a rate limit and I currently use a very simple `Promise.all(versions.map()`)` to aggressively delete all untagged versions. If you have a lot of untagged versions, the action will fail with the following error:
```text
Error: You have exceeded a secondary rate limit. Please wait a few minutes before you try again.
```