Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/endorama/asdf-parse-tool-versions

Parse asdf.sh tool-versions file to reuse version information in GitHub Actions
https://github.com/endorama/asdf-parse-tool-versions

actions asdf github-actions version-manager versions

Last synced: 18 days ago
JSON representation

Parse asdf.sh tool-versions file to reuse version information in GitHub Actions

Awesome Lists containing this project

README

        

typescript-action status

# asdf-parse-tool-versions

Parses asdf [.tool-versions](http://asdf-vm.com/manage/configuration.html#tool-versions) file extracting version information.

Returns a JSON string as output with this format:

```
{"golang":"1.12.5","ruby":"2.7.0"}
```

Each tool has it's own key where value is the value in the `.tool-versions` file.

The action also exports all versions as environment variables with the format `_VERSION` (i.e. `GOLANG_VERSION`).

## Usage

```yaml
---
name: run on master

on:
push:
branches:
- main

jobs:
nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: gather versions
uses: endorama/asdf-parse-tool-versions@v1
id: versions

- name: install Go
uses: actions/setup-go@v1
with:
go-version: "${{ env.GOLANG_VERSION }}"

# OR using action output
- name: install Go
uses: actions/setup-go@v1
with:
go-version: ${{ fromJSON(steps.versions.outputs.tools).golang }}

# ...
```