mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 07:50:13 +00:00
* fix(ci): a release fails its checks when its notes miss a commit merged after the cut * fix(ci): shorten the release checks comment * fix(ci): find the last release by subject and say to link a deliberate omission
17 lines
628 B
JavaScript
17 lines
628 B
JavaScript
const RELEASE = "chore(?:\\(release\\))?: (?:release|cut) v(\\d+\\.\\d+\\.\\d+)";
|
|
|
|
/** The version a release commit's subject names, or null for any other subject. */
|
|
export function releaseVersionOf(subject) {
|
|
return new RegExp(`^${RELEASE}(?: \\(#\\d+\\))?$`).exec(subject)?.[1] ?? null;
|
|
}
|
|
|
|
/** Whether a commit subject stays out of release notes: a release, a version bump, or an explicit skip. */
|
|
export function skipsChangelog(subject) {
|
|
const lower = subject.toLowerCase();
|
|
return (
|
|
lower.includes("[skip changelog]") ||
|
|
new RegExp(`^${RELEASE}`).test(lower) ||
|
|
/^chore: bump version/.test(lower)
|
|
);
|
|
}
|