Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add node_modules to git #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renefritze
Copy link

this is described in https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-javascript-action#commit-tag-and-push-your-action and not doing that can lead to users not having @actions/core available for example

@pzhlkj6612
Copy link
Contributor

Interesting, I didn't know that.

A question: did you encounter any issue with absence of the "node_modules" directory?

@renefritze
Copy link
Author

Yeah. Tried to use the action in a workflow before actions/checkout has run. Then I get

Run ilammy/msvc-dev-cmd@460a772e4cf7358f9f2f23773240813e40e7a894
node:internal/modules/cjs/loader:1228
  throw err;
  ^

Error: Cannot find module '@actions/core'
Require stack:
- D:\a\_actions\ilammy\msvc-dev-cmd\460a772e4cf7358f9f2f23773240813e40e7a894\lib.js
- D:\a\_actions\ilammy\msvc-dev-cmd\460a772e4cf7358f9f2f23773240813e40e7a894\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (D:\a\_actions\ilammy\msvc-dev-cmd\460a772e4cf7358f9f2f23773240813e40e7a894\lib.js:1:14)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'D:\\a\\_actions\\ilammy\\msvc-dev-cmd\\460a772e4cf7358f9f2f23773240813e40e7a894\\lib.js',
    'D:\\a\\_actions\\ilammy\\msvc-dev-cmd\\460a772e4cf7358f9f2f23773240813e40e7a894\\index.js'
  ]
}

Node.js v20.18.0

Using my branch instead makes that work.

@pzhlkj6612
Copy link
Contributor

Oh, that's weird. Would you mind posting your workflow config or the link to the YAML file?

@renefritze
Copy link
Author

Oh, that's weird. Would you mind posting your workflow config or the link to the YAML file?

Sorry, can't do that, private repo.
Might be possible to get you a minimal reproducer tomorrow.

If you're generally up for merging this, it's probably a good idea to automate around this a bit. Like make sure running npm install in CI doesn't result in a diff in node_modules? (Which would also make sure I didn't inject some handcrafted malware)

@renefritze
Copy link
Author

Tried setting up a reproducer here https://github.com/renefritze/msvc-dev-cmd_problem_reproducer
Couldn't make it fail in the same way as happened in the private repo 🤷

@pzhlkj6612
Copy link
Contributor

If you're generally up for merging this, it's probably a good idea to automate around this a bit. Like make sure running npm install in CI doesn't result in a diff in node_modules? (Which would also make sure I didn't inject some handcrafted malware)

Yes, I agree. Doing npm install by CI is acceptable.

Couldn't make it fail in the same way as happened in the private repo 🤷

Yeah, that's what I found weird. I didn't use this action in private repositories before.


Since we have only one dependency, I think including "node_modules" does not hurt too much.

"dependencies": {
"@actions/core": "^1.10.0"
},

You can continue committing new code to this PR, and then wait for @ilammy.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants