Skip to content

Commit 88a3c32

Browse files
committed
chore: pass input to env
1 parent 902430f commit 88a3c32

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

.github/actions/determineNodeVersions/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ runs:
3030
shell: bash
3131
id: node-versions
3232
run: node "$GITHUB_ACTION_PATH/dist/index.js"
33-
with:
34-
nodeDisableVersions: ${{ inputs.nodeDisableVersions }}
33+
env:
34+
NODE_DISABLE_VERSIONS: ${{ inputs.nodeDisableVersions }}
3535

.github/actions/determineNodeVersions/dist/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25588,7 +25588,7 @@ const getVersions = async () => {
2558825588
const installedNode = process.versions.node;
2558925589
// Comma separated list of major versions to disable
2559025590
// For example: Set `NODE_DISABLE_VERSIONS` to `18,23`
25591-
const disableVersions = (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.getInput)('nodeDisableVersions').split(',');
25591+
const disableVersions = process.env.NODE_DISABLE_VERSIONS?.split(',') || [];
2559225592
const today = new Date();
2559325593
// Build an array of versions that the current date is between the start and end dates
2559425594
const versions = Object.keys(json)
@@ -25598,7 +25598,7 @@ const getVersions = async () => {
2559825598
return today >= startDate && today <= endDate;
2559925599
})
2560025600
.map((version) => version.replace('v', ''))
25601-
// Remove versions that are disabled via input (via env var)
25601+
// Remove versions that are disabled via env var
2560225602
.filter((version) => {
2560325603
if (disableVersions.includes(version)) {
2560425604
(0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.notice)(`Node version ${version} is disabled via env var`);

.github/actions/determineNodeVersions/src/main.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
66
*/
77

8-
import { setFailed, getInput, setOutput, notice } from '@actions/core';
8+
import { setFailed, setOutput, notice } from '@actions/core';
99

1010
type VersionData = {
1111
start: string;
@@ -32,7 +32,8 @@ export const getVersions = async () => {
3232

3333
// Comma separated list of major versions to disable
3434
// For example: Set `NODE_DISABLE_VERSIONS` to `18,23`
35-
const disableVersions = getInput('nodeDisableVersions').split(',');
35+
const disableVersions = process.env.NODE_DISABLE_VERSIONS?.split(',') || [];
36+
3637

3738
const today = new Date();
3839

@@ -44,7 +45,7 @@ export const getVersions = async () => {
4445
return today >= startDate && today <= endDate;
4546
})
4647
.map((version) => version.replace('v', ''))
47-
// Remove versions that are disabled via input (via env var)
48+
// Remove versions that are disabled via env var
4849
.filter((version) => {
4950
if (disableVersions.includes(version)) {
5051
notice(`Node version ${version} is disabled via env var`);

0 commit comments

Comments
 (0)