Skip to content

Conversation

@akkuman
Copy link

@akkuman akkuman commented Dec 9, 2025

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

Walkthrough

The changes modify the install function in src/goreleaser.ts to implement a cache-first approach. When installing goreleaser, the function now checks the tool-cache for a cached version using a key comprised of "goreleaser-action", the release tag (with leading "v" stripped), and the current OS architecture. If a cached version is found, it returns the corresponding executable path. If no cached version exists, the function proceeds with the existing download, extraction, and caching workflow.

Pre-merge checks

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether the description relates to the changeset. Add a pull request description explaining the purpose, benefits, and implementation details of the cache-first approach for goreleaser tool installation.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: prioritize tools from cache' directly and accurately summarizes the main change: implementing cache-first logic in the install function to prioritize cached goreleaser tools.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/goreleaser.ts (2)

5-5: Align os import with other Node core imports

Other Node core modules in this file use namespace imports (import * as fs from 'fs', etc.). For consistency and to avoid relying on synthetic default imports, consider changing this to:

-import os from 'os';
+import * as os from 'os';

This keeps it aligned with typical @types/node patterns and reduces dependence on esModuleInterop settings.

Please confirm this compiles cleanly with your current tsconfig (especially esModuleInterop / allowSyntheticDefaultImports).


13-19: Cache lookup logic looks consistent with existing caching

The cache-first path looks sound:

  • Tool name ('goreleaser-action') and version normalization (release.tag_name.replace(/^v/, '')) match the later tc.cacheDir call, so cache hits should resolve to the same directories.
  • Using os.arch() for the tc.find arch parameter aligns with the default arch used when caching, so entries should be found for the current runner arch.
  • The returned executable path mirrors the existing exePath construction, so behavior is consistent between cached and freshly-downloaded installs.

One note: since getRelease is still called before checking the cache, you still incur a GitHub API call even on cache hits. If you ever want to fully avoid that on known exact versions (not latest/aliases), you could consider a pre-getRelease cache check keyed off the requested version, but that’s an optional optimization and would require clear semantics for non-exact version inputs.

If you’d like to double-check cache behavior, you can inspect existing cached directories on a runner to ensure they match the find parameters (tool name, normalized tag, and os.arch() result).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d31d51a and 8a36026.

📒 Files selected for processing (1)
  • src/goreleaser.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/goreleaser.ts (1)
src/github.ts (1)
  • GitHubRelease (29-31)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant