Flux CLI action can read its version from a file
Introduced 2026-10-26 · score 0.93
HOW TO USE IT
When pinning Flux CLI in a repository workflow from a version file, set the GitHub Action’s `version-file` input to that file; the action reads the `flux` entry from `.tool-versions` or a single plain-text version. The input is ignored when `version` is set.
steps:
- name: Setup Flux CLI
uses: fluxcd/flux2/action@main
with:
version-file: .flux-version
- name: Run Flux CLI
run: flux version --clientWHY THIS HELPS
Pin the Flux CLI version for a repository workflow from a version file.
BEFORE THIS CHANGE
Hardcode the Flux version in the workflow.
REQUIREMENTS AND LIMITATIONS
- Version: v2.10.0
- version-file: Path to a `.tool-versions` file (reads the `flux` entry) or a plain-text file containing a single version, such as `2.0.0`; ignored when `version` is set.
- version: Flux version to install; when set, `version-file` is ignored. Defaults to latest stable release.
- The input accepts an asdf-format `.tool-versions` file (reads the `flux` entry) or a plain text file containing a single version such as `2.0.0`.
- The input is ignored when `version` is set.
FIRST-PARTY EVIDENCE
- https://github.com/fluxcd/flux2/releases/tag/v2.10.0
- https://github.com/fluxcd/flux2/pull/5975
- https://github.com/fluxcd/flux2/blob/v2.10.0/action/README.md
- https://github.com/fluxcd/flux2/blob/v2.10.0/action/action.yml
Check the installed version and the source before using it. Entry JSON