Skip to content

🐛 GitHub Action working-directory configuration not working #1834

Description

@trueberryless

Prerequisites

Reproduction url

https://github.com/trueberryless/knip-github-actions-working-directory-repro

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

If you define a GitHub Action where you execute some npm (or pnpm) command with a custom defined script from a package.json that is not the root package.json (in a monorepo) and you correctly set the working-directory option to the path where the package.json with this script is located, Knip reports an "Unlisted binary" error.

I made a GitHub repo repro because I couldn't figure out how to open the terminal in Codesandbox and Stackblitz in the minimal reproduction repros linked from docs.

If you go to the .github/workflows/example.yml I explain what the problem is there as well.


I also tried to create a fixture in Knip to show that it is not working, but for some reason the tests always pass. I am a little flabbergasted of this issue to be honest, so I decided to open an issue. Maybe you, Lars, have an idea what is going on here. At this point, it could be that I am overlooking something obvious 😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions