Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
grunt-git-ref-changed-files
Advanced tools
Detects which files have changed between two git refs.
Detects which files have changed between two git refs.
If you haven't used grunt before, be sure to check out the Getting Started guide.
From the same directory as your project's Gruntfile and package.json, install this plugin with the following command:
npm install grunt-git-ref-changed-files
Once that's done, add this line to your project's Gruntfile:
grunt.loadNpmTasks('grunt-git-ref-changed-files');
Inside your Gruntfile.js
file add a section named refChangedFiles
. This section specifies the
options to detect which files have changed between two refs (from/to) and a regular expression to filter them.
It will query which files have changed since the specified from/to parameter using git by running:
git log {ref}..{ref} --name-only --pretty=format:
Finally it will filter the changed files by applying the regexp option to every item. The result of the filtered files changed will be stored in a grunt config item called refChangedFiles.
Example to detect if static files where modified since v.100 tag:
refChangedFiles: {
dist: {
options: {
from: 'v.100', // optional: default is HEAD^
to: 'HEAD', // optional: default is HEAD
regexp: /public\/lib\/js/, // optional: default is /.*/
},
src: 'repoFolder'
}
}
Then you can access to the filtered changed files using:
grunt.config.get('refChangedFiles');
Copyright (c) 2013 Juan Pablo Garcia Licensed under the MIT license.
FAQs
Detects which files have changed between two git refs.
We found that grunt-git-ref-changed-files demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.