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: about 1 year ago
JSON representation
Parse asdf.sh tool-versions file to reuse version information in GitHub Actions
- Host: GitHub
- URL: https://github.com/endorama/asdf-parse-tool-versions
- Owner: endorama
- License: mit
- Created: 2022-03-11T15:20:53.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T05:32:25.000Z (over 1 year ago)
- Last Synced: 2024-09-23T15:47:04.612Z (over 1 year ago)
- Topics: actions, asdf, github-actions, version-manager, versions
- Language: TypeScript
- Homepage:
- Size: 1.46 MB
- Stars: 10
- Watchers: 3
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# 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 }}
# ...
```