diff --git a/etc/check-remote.sh b/etc/check-remote.sh new file mode 100644 index 00000000000..98e115ee5ea --- /dev/null +++ b/etc/check-remote.sh @@ -0,0 +1,6 @@ +#! /bin/bash + +if git remote get-url --push origin | grep -qv "github.com:mongodb"; then + echo "git remote does not match node-mongodb-native. are you working off of a fork?" + exit 1 +fi diff --git a/etc/docs/build.ts b/etc/docs/build.ts index cdb275045d6..d2b8c4d973f 100755 --- a/etc/docs/build.ts +++ b/etc/docs/build.ts @@ -73,6 +73,8 @@ async function updateSiteTemplateForNewVersion( } async function main() { + await exec('bash ./etc/check-remote.sh'); + chdir(__dirname); const { tag, status, skipPrompts } = getCommandLineArguments(); diff --git a/package.json b/package.json index 63e3ffa5924..aeca0e6342e 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "fix:eslint": "npm run check:eslint -- --fix", "prepare": "node etc/prepare.js", "preview:docs": "ts-node etc/docs/preview.ts", - "release": "standard-version -a -i HISTORY.md", + "release": "bash etc/check-remote.sh && standard-version -a -i HISTORY.md", "test": "npm run check:lint && npm run test:all", "test:all": "npm run check:unit && npm run check:test", "update:docs": "npm run build:docs -- --yes"