-
Notifications
You must be signed in to change notification settings - Fork 0
/
commit-msg.js
24 lines (20 loc) · 1.04 KB
/
commit-msg.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const getAddMessage = async (changeset, options) => {
const skipCI = (options === null || options === void 0 ? void 0 : options.skipCI) === "add" || (options === null || options === void 0 ? void 0 : options.skipCI) === true;
return `docs(changeset): ${changeset.summary}${skipCI ? `\n\n[skip ci]\n` : ""}`;
};
const getVersionMessage = async (releasePlan, options) => {
const skipCI = (options === null || options === void 0 ? void 0 : options.skipCI) === "version" || (options === null || options === void 0 ? void 0 : options.skipCI) === true;
const publishableReleases = releasePlan.releases.filter(release => release.type !== "none");
const numPackagesReleased = publishableReleases.length;
const releasesLines = publishableReleases.map(release => ` ${release.name}@${release.newVersion}`).join("\n");
return `chore: releasing ${numPackagesReleased} package(s)
Releases:
${releasesLines}
${skipCI ? `\n[skip ci]\n` : ""}
`;
};
const defaultCommitFunctions = {
getAddMessage,
getVersionMessage
};
exports.default = defaultCommitFunctions;