Skip to content

Commit 4dffd86

Browse files
committed
validate branch
1 parent 98cef6d commit 4dffd86

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/mintlify-post-processing/push-to-docs-repo.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ function main() {
164164
process.exit(1);
165165
}
166166

167+
if (!/^[a-zA-Z0-9\-_\/]+$/.test(branch)) {
168+
console.error(
169+
"Error: Invalid branch name. Branch name must contain only letters, numbers, hyphens, underscores, and forward slashes."
170+
);
171+
process.exit(1);
172+
}
173+
167174
console.log(`Branch: ${branch}`);
168175

169176
if (

0 commit comments

Comments
 (0)