Skip to content
code

GitHub Action

@paulo-ferraz-oliveira/parse-tool-versions

v1.0.3 Latest version

@paulo-ferraz-oliveira/parse-tool-versions

code

@paulo-ferraz-oliveira/parse-tool-versions

Parse a `.tool-versions` file (as specified by `asdf`) and make tool/versions available as outputs from an identified step.

Installation

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

              

- name: @paulo-ferraz-oliveira/parse-tool-versions

uses: paulo-ferraz-oliveira/parse-tool-versions@v1.0.3

Learn more about this action in paulo-ferraz-oliveira/parse-tool-versions

Choose a version

parse-tool-versions

MacOS Ubuntu Windows

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.

Usage

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.

Example .github/workflows/ci.yml

---
"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

Example .tool-versions

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

Target platforms

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.

Versioning

This project adheres to Semantic Versioning.

Readme

We get inspiration for our README's format/content from Make a README.

Changelog

See the Releases page.

Contributing

Check CONTRIBUTING.

License

Check LICENSE.