Add --version to test in package managers by kachick · Pull Request #135 · github/gh-actions-lock · GitHub
Skip to content

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

Merged
nodeselector merged 2 commits into
github:mainfrom
kachick:add-version-flag
Oct 9, 2026
Merged

nodeselector merged 2 commits into
github:mainfrom
kachick:add-version-flag

Conversation

@kachick

@kachick kachick commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

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)

@kachick kachick mentioned this pull request Oct 4, 2026
7 of 13 tasks

@nodeselector nodeselector left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the contribution.

@nodeselector
nodeselector merged commit 152cf29 into github:main Oct 9, 2026
4 of 5 checks passed
@kachick

kachick commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@kachick
kachick deleted the add-version-flag branch October 10, 2026 00:52
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.

3 participants