Skip to content

Add mise.toml support - #787

Open
leifarriens wants to merge 2 commits into
actions:mainfrom
leifarriens:feat/mise-toml-support
Open

leifarriens wants to merge 2 commits into
actions:mainfrom
leifarriens:feat/mise-toml-support

Conversation

@leifarriens

Copy link
Copy Markdown

Description:
Add support for reading Go versions from mise.toml files supplied through go-version-file.

This supports scalar, object, and array-form tool entries. For arrays, setup-go selects the first version, matching mise's default behavior.

Related issue:
N/A

Check list:

  • Documentation changes are required and included.
  • Tests were added or updated to cover the changes.

Copilot AI lite review requested due to automatic review settings August 30, 2026 04:21
@leifarriens
leifarriens requested a review from a team as a code owner August 30, 2026 04:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds mise.toml as a supported go-version-file source so workflows using mise can pin Go versions without duplicating configuration elsewhere.

Changes:

  • Parse Go versions from mise.toml ([tools].go) supporting scalar, object ({ version = "…" }), and array forms (first entry).
  • Add smol-toml dependency and update bundled dist output accordingly.
  • Update docs, CI workflow coverage, and unit tests to include mise.toml examples/cases.
File summaries
File Description
src/installer.ts Adds mise.toml parsing logic to parseGoVersionFile.
README.md Updates usage docs to mention mise.toml as a valid go-version-file.
package.json Adds smol-toml dependency.
package-lock.json Locks smol-toml dependency and transitive metadata.
docs/advanced-usage.md Documents mise.toml behavior and adds an example snippet.
dist/setup/index.js Updates bundled action output including TOML parser code and regenerated symbol names.
action.yml Updates input description to include mise.toml.
.licenses/npm/smol-toml.dep.yml Adds license attribution entry for the new dependency.
.github/workflows/versions.yml Adds a workflow job to validate go-version-file with mise.toml across OSes.
tests/setup-go.test.ts Adds unit tests for scalar/object/array mise.toml parsing.
tests/data/mise.toml Adds test fixture mise.toml used by workflow verification.
Review details
  • Files reviewed: 9/11 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/installer.ts
Comment on lines +676 to +689
const first = Array.isArray(go) ? go[0] : go;

if (typeof first === 'object' && typeof first?.version === 'string') {
return first.version;
}

if (typeof first === 'string') {
return first;
}

return '';
} catch {
// Fall through to the plain-text parser for invalid TOML.
}

This branch has not been deployed

No deployments
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.

3 participants