fix: npm ci --ignore-scripts across all workflows#12
Merged
Conversation
SonarCloud flagged that package-manager install scripts should not run during installation — dependency lifecycle scripts (preinstall/install/postinstall) run arbitrary code at install time. Add --ignore-scripts to every runnable npm ci: - .github/workflows/ci.yml, .github/workflows/triage.yml (repo CI + triage) - examples/github-pr-label-actions, triage-github-actions (Actions workflows) - examples/triage-jira-gitlab-runner/.gitlab-ci.yml (GitLab before_script) - matching README YAML snippets kept in sync Verified both GitHub-Actions examples install + tsc + flue build (and the pr-label-actions agent runs end-to-end) with --ignore-scripts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
SonarCloud flagged (on the powertools PR that vendors this example) that package-manager install scripts should not run during installation — dependency lifecycle scripts (
preinstall/install/postinstall) execute arbitrary code from dependencies at install time, a supply-chain risk.Change
Add
--ignore-scriptsto every runnablenpm ciin the repo:.github/workflows/ci.yml— repo CI (the required check).github/workflows/triage.yml— repo-root triageexamples/github-pr-label-actions/.github/workflows/pr-label-actions.yml— source-of-truth for the vendored copy shipped to consumersexamples/triage-github-actions/.github/workflows/triage.ymlexamples/triage-jira-gitlab-runner/.gitlab-ci.yml— GitLabbefore_scriptREADME mermaid/prose mentions of "npm ci" (diagram labels, not commands) were left as-is.
Verification
npm ci --ignore-scripts+tsc --noEmit+flue build --target nodeall clean.pr-label-actionsagent also ran end-to-end with--ignore-scripts(skill activated, GitHub tools called, correct decision).The same fix already shipped to the vendored copy in aws-powertools/powertools-lambda-dotnet#1229.