-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore: clear action cache after PR merge #6779
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
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughA new GitHub Actions workflow is introduced that automatically runs when pull requests are closed. The workflow fetches PR-related cache keys and deletes them to maintain cache hygiene. Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub as GitHub Platform
participant Workflow as PR Close Workflow
participant GH as GitHub CLI (gh)
participant Cache as GitHub Cache
GitHub->>Workflow: Pull request closed
Workflow->>GH: gh cache list (filter by branch)
GH->>Cache: Query cache keys
Cache-->>GH: Return matching cache keys
GH-->>Workflow: Cache key list
Workflow->>Workflow: Iterate over each cache key
loop For each cache key
Workflow->>GH: gh cache delete <key>
GH->>Cache: Delete cache entry
Cache-->>GH: Deletion confirmed
end
GH-->>Workflow: All caches deleted
Workflow->>GitHub: Workflow complete
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Proposed changes
Right now we depend upon github to delete the overused cache files after 24 hours which may delete some cache use by other PR. As mentioned in https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manage-caches#force-deleting-cache-entries i have added a workflow to delete the cache related to pull request after the PR get closed
Issue(s)
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments
Summary by CodeRabbit