question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accept a working-directory as an input argument

See original GitHub issue

I’m trying to setup node for my GitHub Action. But I’m not working in the default directory.

I clone a repo in dir_one/rep_one and then clone another repo in dir_two/rep_two and copy a couple of files from the first repo to the second repo.

Then I want to setup Node and npm install on the second repo.

working-directory doesn’t work with uses and I also tried to - run: cd dir_two/repo_two, but again build fails because it’s running in its folder.

I receive this error:

Error: Dependencies lock file is not found in /home/runner/work/Site/Site. Supported file patterns: package-lock.json,yarn.lock

Please create an input argument to accept path where node should search for package.json file.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:46
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
Nefcantocommented, Jul 9, 2021

Hi @dbaker-aa , thank you for that note. However, I’m not going back. Software entities are supposed to move forward and add features, not remove them. This feature should exist in this action to become a more mature action.

7reactions
maxim-lobanovcommented, Jul 15, 2021

Hello everyone!

This feature request will be implemented soon. I have a small ADR under review https://github.com/actions/setup-node/pull/299 . Proposed approach is a bit different from proposed in this issue - we would like allow specifying full path (directory path + filename) to lock file instead of working_directory (directory path only). We believe this approach will be a bit more generic and unblock more use-cases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set a Directory as an Argument in Bash - Stack Overflow
This script takes one argument, a directory name, and touches files in that directory and then displays a directory listing.
Read more >
How to send the current working directory as an argument in ...
Windows maintains the current directory in the environment variable %CD% . echo %CD% c:\users\user pushd c:\temp echo %CD% c:\temp set ...
Read more >
Passing reference or whole directory as input? - CWL Questions
Symlinks to input Files/Directories are passed to the Tool. If a config file specifies an absolute path, the Tool will not be able...
Read more >
Shell Script to Check if Every Passed Argument is a File or ...
Approach 1: Algorithm: First check the provides argument is the directory or not using the if statement using the -d option for the...
Read more >
Adding arguments and options to your Bash scripts - Red Hat
First, add a variable and initialize it. Add the two lines shown in bold in the segment of the program shown below. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found