-
Notifications
You must be signed in to change notification settings - Fork 0
feat: npm build command input #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,12 @@ main() { | |
| echo "${registry_host}/:_authToken=${INPUT_NPM_TOKEN}" > .npmrc | ||
| echo "registry=${registry}" >> .npmrc | ||
|
|
||
| if [[ -n "${INPUT_NPM_BUILD_COMMAND:-}" ]]; then | ||
| echo "Running build: ${INPUT_NPM_BUILD_COMMAND}" | ||
| npm install | ||
| eval "$INPUT_NPM_BUILD_COMMAND" | ||
|
Comment on lines
79
to
+85
|
||
| fi | ||
|
|
||
| npm publish | ||
|
|
||
| rm -f .npmrc | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
evalto run the build command adds an extra round of shell parsing/expansion (beyond whatbash -cwould do) and can lead to unexpected behavior or command injection if the input ever becomes attacker-controlled. Prefer invoking a shell with-c(or restricting this input to annpm run <script>pattern) instead ofeval.