Skip to content

GitHub SCM Plugin: Directory Creation Failure #7642

Description

@josill

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When running tests, the code attempts to create directories at /home/updatecli, which fails on macOS with the error:

time="2026-01-29T21:26:55+02:00" level=error msg="err - mkdir /home/updatecli: operation not supported"

This error occurs multiple times (7 times in the provided logs) because:

  • Multiple test cases specify Directory: "/home/updatecli" (see main_test.go line 34 and other test cases)
  • The setDirectory() function in main.go (lines 458-466) attempts to create this directory using os.MkdirAll()
  • On macOS, /home doesn't exist (macOS uses /Users instead), and creating directories in non-existent parent paths fails with "operation not supported"

Code Location:

  • pkg/plugins/scms/github/main.go:458-466 - setDirectory() function
  • pkg/plugins/scms/github/main_test.go:34 - Multiple test cases with hardcoded /home/updatecli path

Expected Behavior

  • Tests should use platform-agnostic temporary directories or paths that exist on all platforms
  • The setDirectory() function should handle directory creation gracefully, or tests should use paths that are valid on the test platform
  • On macOS, tests should use /tmp or a user-writable directory instead of /home/updatecli
  • Directory creation should succeed without errors on all supported platforms (Linux, macOS, Windows)

Steps To Reproduce

  1. Run the GitHub SCM plugin tests:

    cd /Users/josill/Desktop/Projects/updatecli
    go test ./pkg/plugins/scms/github -v
  2. Observe the errors:

    • Multiple mkdir /home/updatecli: operation not supported error messages appear in the logs

Environment

### Environment
- **OS**: macOS (Darwin 24.6.0, ARM64)
- **Go Version**: go1.25.5 darwin/arm64
- **Test Command**: `go test ./pkg/plugins/scms/github`

Pipeline Graph

No response

Anything else?

No response

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions