feat: use packageManager from package.json as default bun version - #152
Merged
Conversation
Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>
Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>
Co-authored-by: xhyrom <56601352+xhyrom@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Set packageManager as default bun version
feat: use packageManager from package.json as default bun version
Jan 4, 2026
xhyrom
approved these changes
Jan 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the setup-bun action to automatically detect the Bun version from package.json when no explicit version is provided. The action now follows a priority chain: bun-version input → bun-version-file input → package.json packageManager field → package.json engines.bun field → latest. This makes the action more convenient to use while maintaining full backward compatibility.
Key Changes:
- Added automatic version detection from
package.jsonas a fallback when no explicit version inputs are provided - Introduced a
silentparameter toreadVersionFromFile()to suppress warnings during automatic version detection - Added comprehensive test coverage for the new functionality
Reviewed changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/index.ts | Added automatic fallback to read Bun version from package.json with silent mode enabled |
| src/utils.ts | Enhanced readVersionFromFile function with optional silent parameter to suppress warnings during automatic checks |
| tests/utils.spec.ts | Added comprehensive test suite covering package.json version reading, silent mode behavior, and existing file format support |
| README.md | Updated documentation to reflect new default behavior and version resolution priority chain |
| package-lock.json | Version bump to 2.1.0 and compare-versions dependency entry (already used in codebase) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jun 7, 2026
2 tasks
This was referenced Aug 3, 2026
This was referenced Aug 11, 2026
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When no
bun-versionorbun-version-fileinput is provided, the action now automatically reads the bun version frompackage.json, falling back tolatestif not found.Changes
bun-versioninput →bun-version-fileinput →package.jsonpackageManagerfield →package.jsonengines.bunfield →latestsilentparameter toreadVersionFromFile()to suppress warnings when automatically checkingpackage.jsonExample
With
package.json:{ "packageManager": "bun@1.0.25" }The action will now install Bun 1.0.25 without requiring explicit configuration.
Original prompt
packageManagerfrom package.json as default bun version #108💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.