Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add date filter #51

Open
tpak opened this issue Jan 31, 2023 · 0 comments
Open

Add date filter #51

tpak opened this issue Jan 31, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@tpak
Copy link

tpak commented Jan 31, 2023

Describe the feature or problem you’d like to solve

I would like to see all cache's created before or after a certain date.

Proposed solution

add a flag such as:

--age <string> Return caches older than age (1m/2m/1d/2d/xd/1h/6h/xh)

Where the number of months/days/hours is variable and there are options for month/day/hours of age (perhaps minutes)

Additional context

It would benefit users so that we can list old caches and then delete them in a script or understand which branch or branches are aging. This could be combined with a bulk delete operation, as discussed in #20 but would also be useful on the list and delete command.

As I have been configuring cache cleanup jobs, I would like to clean up only caches older than a certain number of days/hours so that branches with high current activity levels do not have their caches deleted unnecessarily. This requires unnecessarily complex pipes to external utilities such as awk/grep etc.

We currently get this type of answer back and need to parse that and cut it down - sometimes it says minutes, hours, or days making it awkward to write a simple script.


gh actions-cache list --order asc --sort last-used -R https://github.com/organization1234/repo8765

Linux-build-cache-node-modules-d627a4016d488c214...  149.00 MB  refs/heads/development  21 hours ago
Linux-build-cache-node-modules-d627a4016d488c214...  149.16 MB  refs/heads/staging      21 hours ago
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant