Skip to content
moon

GitHub Action

moon - Automatic tool versioning

v1.4.0 Latest version

moon - Automatic tool versioning

moon

moon - Automatic tool versioning

Sets `MOON_VERSION` environment variables for moon supported tools

Installation

Copy and paste the following snippet into your .yml file.

              

- name: moon - Automatic tool versioning

uses: moonrepo/[email protected]

Learn more about this action in moonrepo/tool-version-action

Choose a version

moon - Automatic tool versioning (DEPRECATED)

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.

Installation

# ...
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

Inputs

  • node - The Node.js version to resolve. Will set a MOON_NODE_VERSION environment variable.

Testing

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