Skip to content

Commit dabb122

Browse files
✨ feat(config): Add release rules for minor, patch and major releases based on commit type
This commit introduces new release rules to the configuration of semantic-release. The release rules are based on the type of the commit messages. Commits with the prefix "feat" will trigger a minor release, commits with the prefix "fix" or "perf" will trigger a patch release, and commits with the prefix "style", "refactor", or "build" will also trigger a patch release. In addition, there are specific rules for documentation changes and breaking changes. Finally, two special keywords "[force release]" and "[skip release]" have been added to control the release process manually.
1 parent 738941a commit dabb122

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/semantic-release/index.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,41 @@ export default createConfig({
66
# Changelog`,
77
releaseRules: [
88
{
9-
subject: 'feat*',
9+
type: '*feat*',
1010
release: 'minor',
1111
},
1212
{
13-
subject: 'fix*',
13+
type: '*fix*',
1414
release: 'patch',
1515
},
1616
{
17-
subject: 'perf*',
17+
type: '*perf*',
1818
release: 'patch',
1919
},
2020
{
21-
subject: 'style*',
21+
type: '*style*',
2222
release: 'patch',
2323
},
2424
{
25-
subject: 'refactor*',
25+
type: '*refactor*',
2626
release: 'patch',
2727
},
2828
{
29-
subject: 'build*',
29+
type: '*build*',
3030
release: 'patch',
3131
},
32+
{ type: '*docs*', scope: 'README', release: 'patch' },
33+
{ type: '*docs*', scope: 'README.md', release: 'patch' },
34+
{ type: '*docs*', release: false },
3235
{
33-
subject: 'BREAKING CHANGE*',
36+
type: '*BREAKING CHANGE*',
3437
release: 'major',
3538
},
39+
{
40+
subject: '*BREAKING CHANGE*',
41+
release: 'major',
42+
},
43+
{ subject: '*[force release]*', release: 'patch' },
44+
{ subject: '*[skip release]*', release: false },
3645
],
3746
});

0 commit comments

Comments
 (0)