Conversation
The key should be sortable across cache. Signed-off-by: Souma <git@5ouma.me>
There was a problem hiding this comment.
Pull request overview
This PR restructures GitHub Actions cache keys to make them sortable by moving the tool-specific prefix (e.g., bun-, pre-commit-) before the OS identifier. Note that the PR title references "RubyGems" but the actual changes affect Bun and pre-commit cache configurations.
- Cache key format changed from
${{ runner.os }}-<tool>-<hash>to<tool>-${{ runner.os }}-<hash> - Restore keys updated to match the new prefix pattern for pre-commit
- This enables better cache organization and sorting across different operating systems
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| setup-bun-with-cache/action.yml | Updates Bun cache key to prefix with bun- before the OS identifier |
| pre-commit/action.yml | Updates pre-commit cache key and restore-keys to prefix with pre-commit- before the OS identifier |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
22cf6a1 to
8899959
Compare
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThis change updates GitHub Actions caching key formats across two action configuration files. The pre-commit action cache key now uses a "pre-commit-" prefix with OS suffix pattern, while the Bun setup action reorders cache key components from OS-first to bun-first ordering. No logic or control-flow modifications. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
setup-bun-with-cache/action.yml (1)
11-16: Consider adding restore-keys for better cache reuse.Unlike the pre-commit action, this cache configuration doesn't include
restore-keys. Adding a restore-keys entry could improve cache hit rates when the lockfile changes by allowing partial matches:restore-keys: bun-${{ runner.os }}-This would allow the action to reuse caches from the same OS even if
bun.lockhas changed, potentially saving time on dependency installation.🔎 Proposed enhancement
- name: 🫙 Cache node_modules id: cache uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: path: ./node_modules key: bun-${{ runner.os }}-${{ hashFiles('./bun.lock') }} + restore-keys: bun-${{ runner.os }}-
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
pre-commit/action.ymlsetup-bun-with-cache/action.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: 🚸 pre-commit
🔇 Additional comments (2)
pre-commit/action.yml (1)
43-44: LGTM! Cache key format improved for better organization.The new cache key format prefixes with the tool name (
pre-commit-) rather than the OS, which groups related caches together when sorted alphabetically. This achieves the PR's stated objective of making keys "sortable across the cache." The restore-keys pattern is correctly updated to match.Note: This change will invalidate existing caches, requiring a fresh cache build, which is expected behavior for a cache key change.
setup-bun-with-cache/action.yml (1)
16-16: LGTM! Consistent cache key format applied.The cache key now follows the same tool-prefixed pattern as the pre-commit action (
bun-${{ runner.os }}-...), ensuring consistent cache organization across both actions. This change achieves the PR's objective of sortable cache keys.
The key should be sortable across the cache.