You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 387287a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: action.yml
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,9 @@ inputs:
11
11
check-latest:
12
12
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec.'
13
13
default: false
14
+
allow-alpha:
15
+
description: 'Allow alpha releases when no stable release matches the version spec.'
16
+
default: false
14
17
registry-url:
15
18
description: 'Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN.'
Copy file name to clipboardExpand all lines: docs/advanced-usage.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,28 @@ steps:
74
74
- run: npm test
75
75
```
76
76
77
+
## Allow alpha releases
78
+
79
+
The `allow-alpha` input defaults to `false`. Set it to `true` to use an alpha release when no stable release matches the requested version.
80
+
81
+
Alphas are matched by their release version, so `27`, `27.x`, `27.0.0`, `^27.0.0`, and `~27.0.0` all select the newest Node.js 27 alpha. Ranges with an explicit prerelease bound, such as `>=27.0.0-alpha.3`, use standard semver matching.
82
+
83
+
Alpha builds are not published for every platform. For example, Node.js 27 alphas are not available for macOS x64, so setup fails on those runners.
84
+
85
+
```yaml
86
+
steps:
87
+
- uses: actions/checkout@v7
88
+
- uses: actions/setup-node@v7
89
+
with:
90
+
node-version: '27'
91
+
allow-alpha: true
92
+
package-manager-cache: false # Disable automatic npm caching if not required
93
+
- run: npm ci
94
+
- run: npm test
95
+
```
96
+
97
+
Exact alpha versions such as `27.0.0-alpha.0.0.0` work without `allow-alpha`.
98
+
77
99
## Node version file
78
100
79
101
The `node-version-file` input accepts a path to a file containing the version of Node.js to be used by a project, for example `.nvmrc`, `.node-version`, `.tool-versions`, `mise.toml`, or `package.json`. If both the `node-version` and the `node-version-file` inputs are provided then the `node-version` input is used.
0 commit comments