Skip to content

Hooks CI: $GITHUB_WORKSPACE does not expand in the dependency-copy step, failing since at least May #785

Description

@ruvnet

.github/workflows/hooks-ci.yml has been red on main since 2026-08-02, and previously on 2026-05-23. It is path-filtered on npm/packages/cli/**, so it only runs when something touches that directory — which is why it can sit broken unnoticed.

The failure

cp: cannot create directory 'npm/packages/cli/': No such file or directory
##[error]Process completed with exit code 1.

From hooks-ci.yml:76-81:

run: |
  cp -r npm/packages/cli /tmp/cli
  cd /tmp/cli
  npm install --ignore-scripts
  cp -r node_modules $GITHUB_WORKSPACE/npm/packages/cli/

The error names a relative path — 'npm/packages/cli/', not /home/runner/work/RuVector/RuVector/npm/packages/cli/ — so $GITHUB_WORKSPACE expanded to empty. After the preceding cd /tmp/cli, the destination resolves relative to /tmp/cli, where no such directory exists.

Suggested fix

Capture the workspace path before changing directory, rather than relying on the variable surviving into that shell:

run: |
  WS="$PWD"
  cp -r npm/packages/cli /tmp/cli
  cd /tmp/cli
  npm install --ignore-scripts
  cp -r node_modules "$WS/npm/packages/cli/"

Or avoid the round trip entirely by installing in place with npm ci --ignore-scripts and a workspace-aware invocation, since the comment says the copy exists only "to avoid workspace interference".

Why it surfaced now

Noticed while merging #774. A one-line version-sync commit touched npm/packages/cli/package.json and re-triggered the path filter, exposing the pre-existing break. #774 did not cause it and was merged with this check red — worth confirming that reading before relying on this job as a gate.

🤖 Generated with claude-flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions