This GitHub action parses a .tool-versions
file (as
specified by asdf
), found at the root folder of
your GitHub repository, reads the versions declared therein and makes them available as step
outputs variables.
Include, in your GitHub actions' workflows,
- uses: paulo-ferraz-oliveira/parse-tool-versions@v1
id: tool-versions
to set the outputs to use in subsequent steps.
Note: it would be easier to have these accessible from the environment but due to a security restriction Node.js -updated environment variables are not available from one step to the other.
Check our examples below.
---
"on": push
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: paulo-ferraz-oliveira/parse-tool-versions@v1
id: tool-versions
- run: echo ${{steps.tool-versions.outputs.ruby}} # 2.5.3
- run: echo ${{steps.tool-versions.outputs.npm}} # 8.3.1
- run: echo ${{steps.tool-versions.outputs.python}} # 3.7.2
ruby 2.5.3 # This is a comment
# This is another comment
npm 8.3.1
python 3.7.2 2.7.15 system # Only 3.7.2 used
It is our intent that the action runs on all GitHub action environments that support asdf
: at the
moment of this writing, ubuntu-latest
, windows-latest
, and macos-latest
(as well as their
versioned variants).
Open a bug report if that's not the case.
This project adheres to Semantic Versioning.
We get inspiration for our README's format/content from Make a README.
See the Releases page.
Check CONTRIBUTING.
Check LICENSE.