Skip to content

Commit 13f44ca

Browse files
authored
feat: allow release name template through env var (#131)
1 parent 01f8613 commit 13f44ca

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

index.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const preset = 'conventionalcommits'
88
**/
99
const options = {
1010
plugins: [
11-
['@semantic-release/commit-analyzer', {preset}],
12-
['@semantic-release/release-notes-generator', {preset}],
11+
['@semantic-release/commit-analyzer', { preset }],
12+
['@semantic-release/release-notes-generator', { preset }],
1313
[
1414
'@semantic-release/changelog',
1515
{
@@ -18,20 +18,20 @@ const options = {
1818
# 📓 Changelog
1919
2020
All notable changes to this project will be documented in this file. See
21-
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.`,
22-
},
21+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.`
22+
}
2323
],
2424
[
2525
'@semantic-release/exec',
2626
{
27-
prepareCmd: 'npx -y prettier --write CHANGELOG.md',
28-
},
27+
prepareCmd: 'npx -y prettier --write CHANGELOG.md'
28+
}
2929
],
3030
[
3131
'@semantic-release/npm',
3232
{
33-
tarballDir: '.semantic-release',
34-
},
33+
tarballDir: '.semantic-release'
34+
}
3535
],
3636
'semantic-release-license',
3737
[
@@ -43,10 +43,10 @@ All notable changes to this project will be documented in this file. See
4343
'package-lock.json',
4444
'package.json',
4545
'pnpm-lock.yaml',
46-
'yarn.lock',
46+
'yarn.lock'
4747
],
48-
message: 'chore(release): ${nextRelease.version} [skip ci]',
49-
},
48+
message: 'chore(release): ${nextRelease.version} [skip ci]'
49+
}
5050
],
5151
[
5252
'@semantic-release/github',
@@ -57,9 +57,13 @@ All notable changes to this project will be documented in this file. See
5757
releasedLabels: false,
5858
// @TODO remove this before releasing on main
5959
successComment: false,
60-
},
61-
],
62-
],
60+
// Allow customizing the release name via an environment variable
61+
...(process.env.SR_RELEASE_NAME_TEMPLATE && {
62+
releaseNameTemplate: process.env.SR_RELEASE_NAME_TEMPLATE
63+
})
64+
}
65+
]
66+
]
6367
}
6468

6569
module.exports = options

0 commit comments

Comments
 (0)