Skip to content

[BUG] FILE_PATHS '.' includes .git paths and breaks createTree with malformed path component #15

Closed

Description

@c-vigo

Description

commit-action fails when called with FILE_PATHS: . because recursive file discovery includes .git/* files. Those paths are sent to the GitHub Trees API and fail with tree.path contains a malformed path component.

Steps to Reproduce

  1. In any workflow using vig-os/commit-action, set:
    • FILE_PATHS: .
  2. Run the job in a checked-out repository (with .git directory present).
  3. Observe the action log printing committed files, including .git/HEAD, .git/config, .git/hooks/*, .git/objects/*.
  4. Action fails at tree creation with:
    • tree.path contains a malformed path component

Expected Behavior

When FILE_PATHS points to a directory, the action should only include valid repository working-tree files and exclude VCS internals like .git.

Actual Behavior

The action recursively collects .git/* entries and passes them to octokit.rest.git.createTree, causing a hard failure.

Environment

  • OS: GitHub-hosted runner (Ubuntu 22.04)
  • Container Runtime: N/A (GitHub Actions workflow execution)
  • Image Version/Tag: vig-os/commit-action@e7dc876fbb73df9099831fed9bfc402108fd04c3 (v0.1.4)
  • Architecture: AMD64

Additional Context

Possible Solution

In recursive directory expansion, skip .git directories (and defensively filter .git-prefixed paths) before building tree entries for createTree.

Activity

  1. added
    bug
    on Mar 13, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions