Gathering detailed insights and metrics for @cypress/commit-info
Gathering detailed insights and metrics for @cypress/commit-info
Gathering detailed insights and metrics for @cypress/commit-info
Gathering detailed insights and metrics for @cypress/commit-info
npm install @cypress/commit-info
Typescript
Module System
Min. Node Version
Node Version
NPM Version
93.5
Supply Chain
99.5
Quality
74.7
Maintenance
50
Vulnerability
100
License
JavaScript (95.96%)
Shell (3.58%)
Dockerfile (0.46%)
Total Downloads
9,406,329
Last Day
839
Last Week
35,028
Last Month
170,542
Last Year
1,995,935
18 Stars
151 Commits
7 Forks
13 Watchers
4 Branches
18 Contributors
Updated on Apr 04, 2025
Minified
Minified + Gzipped
Latest Version
2.2.0
Package Id
@cypress/commit-info@2.2.0
Unpacked Size
11.59 kB
Size
4.59 kB
File Count
5
NPM Version
6.9.0
Node Version
10.16.3
Cumulative downloads
Total Downloads
Last Day
-5%
839
Compared to previous day
Last Week
-7%
35,028
Compared to previous week
Last Month
5%
170,542
Compared to previous month
Last Year
-67%
1,995,935
Compared to previous year
Collects Git commit info from git CLI
Requires Node version 6 or above.
1npm install --save @cypress/commit-info
1const {commitInfo} = require('@cypress/commit-info') 2// default folder is current working directory 3commitInfo(folder) 4 .then(info => { 5 // info object will have properties 6 // branch 7 // message 8 // email 9 // author 10 // sha 11 // timestamp (in seconds since epoch) 12 // remote 13 })
Notes:
.git
folder and uses Git commands to get each property, like git show -s --pretty=%B
, see src/git-api.js. Note: there is fallback to environment variables.null
for each propertyDEBUG=commit-info
environment variable.If getting the commit information using git
fails for some reason, you can provide the commit information by setting the environment variables. This module will look at the following environment variables as a fallback
branch: COMMIT_INFO_BRANCH
message: COMMIT_INFO_MESSAGE
email: COMMIT_INFO_EMAIL
author: COMMIT_INFO_AUTHOR
sha: COMMIT_INFO_SHA
timestamp: COMMIT_INFO_TIMESTAMP
remote: COMMIT_INFO_REMOTE
When running your application inside a Docker container, you should set these environment variables using -e
syntax.
1$ docker run \ 2 -e COMMIT_INFO_BRANCH=develop \ 3 -e COMMIT_INFO_SHA=e5d9eb66474bc0b681da9240aa5a457fe17bc8f3 \ 4 <container name>
See docker-example for a full example.
In addition to commitInfo
this module also exposes individual promise-returning
methods getBranch
, getMessage
, getEmail
, getAuthor
, getSha
, getTimestamp
, getRemoteOrigin
. These methods do NOT use fallback environment variables.
For example
1const {getAuthor} = require('@cypress/commit-info') 2getAuthor('path/to/repo') 3 .then(name => ...)
Resolves with the current git branch name or null
.
1const {getBranch} = require('@cypress/commit-info') 2getBranch() 3 .then(branch => ...)
HEAD
), returns null
License: MIT - do anything with the code, but don't blame me if it does not work.
Support: if you find any problems with this module, email / tweet / open issue on Github
Copyright (c) 2017 Cypress.io
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
Found 2/6 approved changesets -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
86 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More