Repository navigation
Conversation
This branch has not been deployed
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.
Disclosure up front: I maintain npmscan and npmscan-action, so I have an interest in this. If it isn't a fit, please close it, no hard feelings.
What this does
Following up on #1628 (supply-chain analysis for tedious). Socket needs a GitHub App that only an org admin can install. This is the same kind of check, but as one workflow file you can review and merge like any other change.
It adds
.github/workflows/npmscan.yml, which runs npmscan-action on pull requests that touchpackage.jsonorpackage-lock.json. It diffs both files between the PR base and head, and flags only what changed:preinstall/install/postinstall), the usual sign of a hijacked packageoverrides, and changes to the root package's own lifecycle scriptsOverlap with what you already run
npm audit signaturesstep should already fail a build once a swapped registry tarball gets installed. This check reports the same kind of swap on the PR diff before anything is installed, and it also covers install-script andoverrideschanges, which signature checks don't look at.Tested on this repo
I replayed tedious's own history through the same API the action calls:
@azure-rest/core-client@2.4.0keeps its version but has a differentintegrity. It's flagged as a repointed entry.Configuration
mode: warnandfail-on-error: false. If npmscan.com is down, the job reports a warning and passes.package.jsonorpackage-lock.jsonchanges (plus this workflow, so you can see it run here).comment: on-findingsmeans a PR comment appears only when something is flagged. The full report always goes to the job summary.permissions: {}at the top, and the job gets onlycontents: readandpull-requests: write. Checkout usespersist-credentials: false. Both actions are pinned to full commit SHAs, with atimeout-minutes: 15cap.https://npmscan.com/api/analysis/dependency-diff. Never source code, secrets or the token. Nothing is stored. Package names and versions from the diff are then looked up on the public npm registry and OSV.dev. Details: What leaves your runner.PR template notes
This only adds a workflow file, so there's no code to build, test or lint (template steps 2–5 don't apply). The title follows Conventional Commits.