Skip to content

Add --version to test in package managers - #135

Open
kachick wants to merge 2 commits into
github:mainfrom
kachick:add-version-flag
Open

kachick wants to merge 2 commits into
github:mainfrom
kachick:add-version-flag

Conversation

@kachick

@kachick kachick commented Sep 30, 2026

Copy link
Copy Markdown

Currently, there is no option to get the CLI version in a sadbox environment.
--no-fix --json includes it in .cli_version filed, but it requires a real GitHub account.

# Before
> ./gh-actions-lock --version
✗ unknown flag: --version

# After
> ./gh-actions-lock --version
actions-lock version v0.1.7-rc.1.0.20260904235750-ba0c780d1a56+dirty

I did not add a test like the existing --help. If I need to add one to root_test.go, please let me know.

Currently, there is no option to get the CLI version in a sadbox
environment.
"--no-fix --json" includes it in ".cli_version" filed,
but it requires a real GitHub account.
Copilot AI balanced review requested due to automatic review settings September 30, 2026 16:06
@kachick
kachick requested a review from a team as a code owner September 30, 2026 16:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The new package-manager-facing command needs a test proving it works without authentication or workflow files.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

This PR adds a token-free --version command so package managers can check the CLI without running a workflow scan.

Changes:

  • Sets the root Cobra command’s version from cliVersion().
File Description
cmd/​gh-actions-lock/​root.go Enables the root command’s --version flag.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cmd/gh-actions-lock/root.go
The new --version flag had no test coverage. Add a hermetic test to
verify that it prints the version and exits without calling the resolver
or touching workflows.

Assisted-by: Antigravity:gemini-3.8-flash

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused test covers the new flag, and no unresolved issues remain.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants