Parse .tool-versions
ActionsTags
(2)Github action that parses .tool-versions into the environment.
- name: Parse .tool-versions
uses: wistia/[email protected]
with:
uppercase: 'true'
prefix: 'tool_version_'
filename: '.tool-versions'
# Sometime later in the same job...
- name: Set up Node.js environment
uses: actions/setup-node@v3
with:
node-version: ${{ env.TOOL_VERSION_NODEJS }}
This command reads .tool-versions
(or an alternate text file provided in filename
input), ignores comments with leading #
and outputs each tool name (with or without optional prefix/postfix) into GITHUB_ENV
. All inputs are optional; by default, tool names & prefix/postfix are uppercased.
set this to any string besides 'true' to use snake_case
instead of MACRO_CASE
use to control what is prepended to the tool name (eg. tool_version_
w/ ruby would emit TOOL_VERSION_RUBY
)
use to control what is appended to the tool name (eg. _tool_version
w/ ruby would emit RUBY_TOOL_VERSION
)
The filename read from; this can be a path
Parse .tool-versions is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.