Skip to content

install: GitHub Contents API fallback drops the exec bit on scripts #439

Closed

Description

@runkids

Problem

When a subdir install falls back to the GitHub Contents API, every file is written with mode 0644. Scripts under a skill's scripts/ lose their exec bit on that path, while the sparse-checkout and clone paths preserve it (copyDir keeps modes). Users hit it only when sparse checkout fails, which makes it look intermittent.

Evidence (v0.25.0, aeaea40e)

  • internal/install/github_download.go:175 — os.OpenFile(destPath, O_CREATE|O_TRUNC|O_WRONLY, 0644)
  • internal/install/copy.go — the git paths preserve file mode

Fix

The Contents API does not return the mode, but the tree API (GET /repos/{owner}/{repo}/git/trees/{sha}?recursive=1) returns mode (100755) per entry. Either fetch the tree once and apply modes, or at minimum mark files under scripts/ executable. Add a test with a 100755 fixture.

Found while researching #239 (shared scripts, §2); relevant to any skill that ships scripts.

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