action-parse-asdf-tool-versions

CI

Parse asdf managed .tool-versions with asdf-vm built-in function.
So will work even if the .tool-versions using comments and multiple versions.

Usage

Only need id field for this action

jobs:
  asdf-parser:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    steps:
      - uses: actions/checkout@v3
      - uses: kachick/action-parse-asdf-tool-versions@v1
        id: parse
    outputs:
      tool-versions: "${{ steps.parse.outputs.json }}"
  test:
    needs: [asdf-parser]
    timeout-minutes: 15
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: "${{ fromJson(needs.asdf-parser.outputs.tool-versions).nodejs }}"
      - run: npm ci
      - run: npm test

Major setup-* actions provide input option as *-version. Use this action and pass to them keep consistency of repository's .tool-versions and CI.
Actual working examples are below.