diff --git a/lib.ts b/lib.ts index 3d9e3ce..3f16175 100644 --- a/lib.ts +++ b/lib.ts @@ -109,6 +109,23 @@ export const RELEASE_RULE: ReleaseRuleItem[] = [ output: undefined, }], }, + { + matchVersion: (url: string) => { + return url.match( + /https:\/\/.+\/.*?v(?[\d.-]+)/, + ); + }, + version: ({ match }) => { + return `v${match?.groups?.version?.replaceAll("-", ".")}`; + }, + tests: [{ + input: "https://biomejs.dev/blog/biome-v1-6/", + output: "v1.6", + },{ + input: "https://example.com/voooo1-6", + output: undefined, + }], + }, ]; export const URL_RULES: RuleItem[] = [