New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

git-origin-check

Package Overview
Dependencies
Maintainers
8
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-origin-check - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

lib/originCheck.js

@@ -24,2 +24,4 @@ const gitRemoteOriginUrl = require('git-remote-origin-url');

}
return true;
};

2

package.json
{
"name": "git-origin-check",
"version": "1.0.2",
"version": "1.0.3",
"description": "Validates Git origin is set to correct host.",

@@ -5,0 +5,0 @@ "bin": {

@@ -8,6 +8,8 @@ # git-origin-check

Validates Git origin is set to correct host. When used in combination with Husky as a `pre-push` hook it enables users to ensure code is not inadvertently pushed to the wrong Github instance.
Validates Git origin is set to the correct host. When used in combination with Husky as a `pre-push` hook it enables users to ensure code is not inadvertently pushed to the wrong Github instance. This will check static origin URLs as well as SSH aliases for the correct URL.
Example Usage:
## Example Usage:
### 1. Install Module
```

@@ -17,1 +19,10 @@ npm install git-origin-check

```
### 2. Add Husky Hook
```
"husky": {
"hooks": {
"pre-push": "git-origin-check github.com"
}
}
```

@@ -1,8 +0,19 @@

var assert = require('chai').assert;
const originCheck = require('../lib/originCheck.js');
const assert = require('chai').assert;
describe('git-origin-check', () => {
it('should write some tests', (done) => {
// TODO!
done();
describe('git-origin-check', async () => {
it('should pass with default repo of github.com', async () => {
assert(await originCheck.check('github.com'), 'github.com pass');
});
it('should fail with default repo of github.com when checking github.co', async () => {
try{
await originCheck.check('github.co');
assert(false, 'github.co shouldnt pass');
} catch(e){
assert(true, 'github.co should fail');
}
});
// TODO: test cases for ssh aliases
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc