Skip to content

Commit 24bea8d

Browse files
fix(update-skills): enhance branch name validation to prevent invalid prefixes
1 parent c13ddc0 commit 24bea8d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/update-skills.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { join, relative, resolve } from "path";
55
const root = resolve(__dirname, "..");
66
const branch = process.argv[2] || "master";
77

8-
if (!/^[\w.\-/]+$/.test(branch)) {
8+
if (!/^[\w.\-/]+$/.test(branch) || branch.startsWith("-")) {
99
// eslint-disable-next-line no-console
1010
console.error(`[update-skills] Invalid branch name: '${branch}'`);
1111
process.exit(1);

0 commit comments

Comments
 (0)