Skip to content

Commit c4c560c

Browse files
chore(NODE-4824): add check to confirm docs generation and release only runs on main repo (#3468)
1 parent fda7d25 commit c4c560c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

etc/check-remote.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#! /bin/bash
2+
3+
if git remote get-url --push origin | grep -qv "github.com:mongodb"; then
4+
echo "git remote does not match node-mongodb-native. are you working off of a fork?"
5+
exit 1
6+
fi

etc/docs/build.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ async function updateSiteTemplateForNewVersion(
7373
}
7474

7575
async function main() {
76+
await exec('bash ./etc/check-remote.sh');
77+
7678
chdir(__dirname);
7779

7880
const { tag, status, skipPrompts } = getCommandLineArguments();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"fix:eslint": "npm run check:eslint -- --fix",
122122
"prepare": "node etc/prepare.js",
123123
"preview:docs": "ts-node etc/docs/preview.ts",
124-
"release": "standard-version -a -i HISTORY.md",
124+
"release": "bash etc/check-remote.sh && standard-version -a -i HISTORY.md",
125125
"test": "npm run check:lint && npm run test:all",
126126
"test:all": "npm run check:unit && npm run check:test",
127127
"update:docs": "npm run build:docs -- --yes"

0 commit comments

Comments
 (0)