Skip to content

fix(paths): add support for expanding $HOME#99

Merged
ashishkurmi merged 3 commits into
step-security:mainfrom
shubham-stepsecurity:sm/fix
May 22, 2026
Merged

fix(paths): add support for expanding $HOME#99
ashishkurmi merged 3 commits into
step-security:mainfrom
shubham-stepsecurity:sm/fix

Conversation

@shubham-stepsecurity
Copy link
Copy Markdown
Member

What does this PR do?

Type of change

  • Bug fix
  • Enhancement
  • Documentation

Testing

  • Tested on macOS (version: ___)
  • Binary runs without errors: ./stepsecurity-dev-machine-guard --verbose
  • JSON output is valid: ./stepsecurity-dev-machine-guard --json | python3 -m json.tool
  • No secrets or credentials included
  • Lint passes: make lint
  • Tests pass: make test

Related Issues

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds home-directory token expansion to the agent install-dir resolution so values like $HOME/... and ~/... are turned into concrete paths before being used for logging/state locations.

Changes:

  • Expand a leading $HOME or ~ in paths.Home() inputs (CLI flag, env var, config field) via a new expandHome helper.
  • Add unit tests covering $HOME/~ expansion behavior and ensuring non-token absolute paths remain unchanged.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
internal/paths/paths.go Adds expandHome and applies it to all non-legacy Home() sources.
internal/paths/paths_test.go Adds tests validating $HOME/~ expansion in config/env/CLI sources.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/paths/paths.go
Comment thread internal/paths/paths.go Outdated
Comment thread internal/paths/paths_test.go Outdated
Comment thread internal/paths/paths_test.go Outdated
Comment thread internal/paths/paths_test.go Outdated
@ashishkurmi ashishkurmi self-requested a review May 22, 2026 04:39
@ashishkurmi ashishkurmi merged commit 0e007ef into step-security:main May 22, 2026
11 checks passed
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