[get-nodejs-versions-array-action
] New Feature
#681
Replies: 3 comments 2 replies
-
Some features could be substituted with GitHub Actions jobs:
detect-supported-node:
runs-on: ubuntu-latest
outputs:
versions-json: ${{ steps.detector.outputs.versions-json }}
steps:
- id: detector
uses: sounisi5011/npm-packages@actions/get-nodejs-versions-array-v0
unit-test:
needs: detect-supported-node
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.detect-supported-node.outputs.versions-json) }}
include:
- node-version: 12.17.0
- node-version: 12.20.0
- node-version: 14.1.0
- node-version: 14.13.0
- node-version: 14.18.0
- node-version: 18.0.0
- detect-supported-node: true
exclude:
- node-version: 14.0.0
steps:
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }} This feature is attractive because it allows users to consolidate definitions in one place, but at the expense of increasing our maintenance costs. |
Beta Was this translation helpful? Give feedback.
-
The parser for the Also, the definition of the Instead, it is better to use a custom action that sets the output based on a semver range. For example: jobs:
detect-supported-node:
runs-on: ubuntu-latest
outputs:
versions-json: ${{ steps.detector.outputs.versions-json }}
steps:
- id: detector
uses: sounisi5011/npm-packages@actions/get-nodejs-versions-array-v0
unit-test:
needs: detect-supported-node
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ${{ fromJson(needs.detect-supported-node.outputs.versions-json) }}
steps:
- name: Setup Node.js ${{ matrix.node-version }}
id: setup-node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: madhead/semver-utils@latest
id: use-old-corepack
with:
# Instead of using "matrix.node-version", use the "node-version" output of the "actions/setup-node".
# Because the value of "matrix.node-version" is not a version. It is a semver range.
version: ${{ steps.setup-node.outputs.node-version }}
satisfies: <14.14.0
- name: Use old Corepack
if: steps.use-old-corepack.outputs.satisfies
run: npm install --global "corepack@<0.11" |
Beta Was this translation helpful? Give feedback.
-
I think the jobs:
detect-supported-node:
runs-on: ubuntu-latest
outputs:
versions-json: ${{ steps.detector.outputs.versions-json }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: path/to
- id: detector
uses: sounisi5011/npm-packages@actions/get-nodejs-versions-array-v0
with:
working-directory: path/to |
Beta Was this translation helpful? Give feedback.
-
I would like to add the following new feature to
get-nodejs-versions-array-action
.Beta Was this translation helpful? Give feedback.
All reactions