Add a step to you workflow to read the versions from .tool-versions:
- name: Read .tool-versions
uses: romeovs/tool-versions-action@v3
id: versionsThen, use the outputs of that step, for example:
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: ${{ steps.versions.outputs.pnpm }}path: path of the.tool-versionsfile, defaults to.tool-versions
This action creates one output per entry in the .tool-versions file, containing
the version.
name: Get version info
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Read .tool-versions
uses: romeovs/tool-versions-action@v3
id: versions
- uses: pnpm/action-setup@v2
name: Install pnpm ${{ steps.versions.outputs.pnpm }}
with:
version: ${{ steps.versions.outputs.pnpm }}
- name: Use Node.js ${{ steps.versions.outputs.nodejs}}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodejs}}The scripts and documentation in this project are released under the MIT License.