Skip to content

Commit

Permalink
docs(release): add custom commit message for 🦋 changesets
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed Aug 18, 2023
1 parent 82c2142 commit 3aaab55
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .changeset/commit.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const getAddMessage = async (changeset, options) => {
const skipCI = options?.skipCI === "add" || options?.skipCI === true;
return `docs(changeset): ${changeset.summary}
[skip ci]
`;
};

const getVersionMessage = async (releasePlan, options) => {
const skipCI = options?.skipCI === "version" || options?.skipCI === true;

const publishableReleases = releasePlan.releases.filter(
(release) => release.type !== "none",
);

const numPackagesReleased = publishableReleases.length;

const releaseLines = publishableReleases
.map((release) => ` ${release.name}@${release.newVersion}`)
.join("\n");

return `chore(release): version bump
${releaseLines}
[skip ci]
`;
};

module.exports = {
getAddMessage,
getVersionMessage,
};
3 changes: 2 additions & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "iiroj/iiro.fi" }],
"commit": true,
"commit": "./commit.cjs",
"access": "restricted",
"title": "",
"baseBranch": "main"
}

0 comments on commit 3aaab55

Please sign in to comment.