Skip to content

Commit 3981ad1

Browse files
committed
feat: add support for mise.toml file
1 parent dda4788 commit 3981ad1

File tree

7 files changed

+26235
-6109
lines changed

7 files changed

+26235
-6109
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This action provides the following functionality for GitHub Actions users:
1616

1717
- Caching is now automatically enabled for npm projects when either the `devEngines.packageManager` field or the top-level `packageManager` field in `package.json` is set to `npm`. For other package managers, such as Yarn and pnpm, caching is disabled by default and must be configured manually using the `cache` input.
1818

19-
## Breaking changes in V5
19+
## Breaking changes in V5
2020

2121
- Enabled caching by default with package manager detection if no cache input is provided.
2222
> For workflows with elevated privileges or access to sensitive information, we recommend disabling automatic caching by setting `package-manager-cache: false` when caching is not needed for secure operation.
@@ -39,23 +39,23 @@ See [action.yml](action.yml)
3939
# Examples: 12.x, 10.15.1, >=10.15.0, lts/Hydrogen, 16-nightly, latest, node
4040
node-version: ''
4141

42-
# File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions.
43-
# If node-version and node-version-file are both provided the action will use version from node-version.
42+
# File containing the version Spec of the version to use. Examples: package.json, mise.toml, .nvmrc, .node-version, .tool-versions.
43+
# If node-version and node-version-file are both provided the action will use version from node-version.
4444
node-version-file: ''
4545

46-
# Set this option if you want the action to check for the latest available version
46+
# Set this option if you want the action to check for the latest available version
4747
# that satisfies the version spec.
48-
# It will only get affect for lts Nodejs versions (12.x, >=10.15.0, lts/Hydrogen).
48+
# It will only get affect for lts Nodejs versions (12.x, >=10.15.0, lts/Hydrogen).
4949
# Default: false
5050
check-latest: false
5151

5252
# Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.
53-
# Default: ''. The action use system architecture by default
53+
# Default: ''. The action use system architecture by default
5454
architecture: ''
5555

56-
# Used to pull node distributions from https://github.com/actions/node-versions.
57-
# Since there's a default, this is typically not supplied by the user.
58-
# When running this action on github.com, the default value is sufficient.
56+
# Used to pull node distributions from https://github.com/actions/node-versions.
57+
# Since there's a default, this is typically not supplied by the user.
58+
# When running this action on github.com, the default value is sufficient.
5959
# When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
6060
#
6161
# We recommend using a service account with the least permissions necessary. Also
@@ -76,18 +76,18 @@ See [action.yml](action.yml)
7676
# default: true
7777
package-manager-cache: true
7878

79-
# Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc.
80-
# It will generate hash from the target file for primary key. It works only If cache is specified.
79+
# Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc.
80+
# It will generate hash from the target file for primary key. It works only If cache is specified.
8181
# Supports wildcards or a list of file names for caching multiple dependencies.
8282
# Default: ''
8383
cache-dependency-path: ''
8484

85-
# Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file,
85+
# Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file,
8686
# and set up auth to read in from env.NODE_AUTH_TOKEN.
8787
# Default: ''
8888
registry-url: ''
8989

90-
# Optional scope for authenticating against scoped registries.
90+
# Optional scope for authenticating against scoped registries.
9191
# Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/).
9292
# Default: ''
9393
scope: ''

__tests__/main.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1+
import * as cache from '@actions/cache';
12
import * as core from '@actions/core';
23
import * as exec from '@actions/exec';
3-
import * as tc from '@actions/tool-cache';
4-
import * as cache from '@actions/cache';
54
import * as io from '@actions/io';
5+
import * as tc from '@actions/tool-cache';
66

77
import fs from 'fs';
8-
import path from 'path';
98
import osm from 'os';
9+
import path from 'path';
1010

1111
import each from 'jest-each';
1212

13+
import OfficialBuilds from '../src/distributions/official_builds/official_builds';
1314
import * as main from '../src/main';
1415
import * as util from '../src/util';
15-
import OfficialBuilds from '../src/distributions/official_builds/official_builds';
1616

1717
describe('main tests', () => {
1818
let inputs = {} as any;
@@ -109,6 +109,7 @@ describe('main tests', () => {
109109
${'{"volta": {"node": ">=14.0.0 <=17.0.0"}}'}| ${'>=14.0.0 <=17.0.0'}
110110
${'{"volta": {"extends": "./package.json"}}'}| ${'18.0.0'}
111111
${'{"engines": {"node": "17.0.0"}}'} | ${'17.0.0'}
112+
${'[tools]\ngo="latest"\nnode = "24.10"'} | ${'24.10'}
112113
${'{}'} | ${null}
113114
`.it('parses "$contents"', ({contents, expected}) => {
114115
const existsSpy = jest.spyOn(fs, 'existsSync');

0 commit comments

Comments
 (0)