This action is deprecated and will be removed in the future. moon >= 1.14 supports partial versions, and overriding versions with environment variables. Learn more: https://moonrepo.dev/docs/guides/open-source
Since moon requires fully-qualified semantic versions for tools
in its toolchain, this action will automatically determine valid versions based on a partial
version. For example, 14
will resolve to 14.10.12
.
It achieves this by resolving an input against the tool's official manifest (or GitHub's manifest) to determine a valid semantic version. Once resolved, it will set moon specific environment variables for subsequent steps.
# ...
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- uses: moonrepo/tool-version-action@v1
with:
node: 16
- run: moon ci
Multiple versions can be supported through GitHub actions matrix.
# ...
jobs:
ci:
name: CI
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14, 16, 18]
steps:
- uses: moonrepo/tool-version-action@v1
with:
node: ${{ matrix.node-version }}
- run: moon ci
node
- The Node.js version to resolve. Will set aMOON_NODE_VERSION
environment variable.
This action can be tested locally by defining an environment variable for the input you'd like test,
and running the test:input
script. For example, if you'd like to test Node.js:
INPUT_NODE=16 npm run test:input