Skip to content

Add version-file input to the Flux CLI action - #5975

Merged
stefanprodan merged 1 commit into
fluxcd:mainfrom
somaz94:action-version-file
Jul 24, 2026
Merged

Add version-file input to the Flux CLI action#5975
stefanprodan merged 1 commit into
fluxcd:mainfrom
somaz94:action-version-file

Conversation

@somaz94

@somaz94 somaz94 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The Flux CLI action can now read the version from a file via a new version-file input, so the version can be pinned in a .tool-versions (asdf) or plain version file instead of hardcoded in the workflow. The input is ignored when version is set, so existing workflows are unaffected.

Validation:

  • YAML lint of action/action.yml and the workflow: pass
  • Local simulation of the resolution logic (plain file, .tool-versions with flux/flux2 key, v prefix, missing-file and empty-file errors) behaves as expected
  • Added a version-file CI job in .github/workflows/action.yaml exercising both fixture formats

AI assistance was used for this change, disclosed via the Assisted-by commit trailer.

@somaz94
somaz94 force-pushed the action-version-file branch from 46704c8 to b8bb4af Compare July 9, 2026 03:36
@somaz94
somaz94 marked this pull request as ready for review July 9, 2026 03:37
@somaz94
somaz94 force-pushed the action-version-file branch from b8bb4af to bfd430b Compare July 13, 2026 02:51
@somaz94
somaz94 force-pushed the action-version-file branch from bfd430b to c0a4ef4 Compare July 24, 2026 06:53
@stefanprodan stefanprodan added area/ci CI related issues and pull requests enhancement New feature or request labels Jul 24, 2026
Comment thread .github/workflows/action.yaml Outdated
run: |
set -euo pipefail
flux -v
flux -v | grep -q '2.8.8'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make the .tool-versions install 2.9.2 and test here the version

@somaz94

somaz94 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Done — the .tool-versions fixture now installs flux 2.9.2 (distinct from the plain .flux-version fixture's 2.8.8), and the assert step checks for 2.9.2. The differing versions prove the CLI version is resolved from the .tool-versions file rather than coincidentally matching a shared value. Pushed in ba9a4c6.

@stefanprodan

Copy link
Copy Markdown
Member

Please squash the 2 commits and force push, your last commit has no signoff.

Signed-off-by: somaz <genius5711@gmail.com>
@somaz94
somaz94 force-pushed the action-version-file branch from ba9a4c6 to 31bdd6e Compare July 24, 2026 09:11
@somaz94

somaz94 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Squashed into a single signed-off commit and force-pushed — DCO should be green now. Regarding the .tool-versions version: the fixture already installs a distinct flux 2.9.2 (vs 2.8.8 in the plain .flux-version fixture), and the CI job asserts it with flux -v | grep -q '2.9.2', so the resolved version is verified end-to-end. Thanks for the review!

@stefanprodan stefanprodan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @somaz94

@stefanprodan
stefanprodan merged commit bc924b0 into fluxcd:main Jul 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI related issues and pull requests enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants