You can obtain the name of the repository in the sharable configuration for semantic-release by using the pkg.name
property in the package.json
file of your project. Here is an example:
// sharable configuration for semantic-release
module.exports = {
branch: 'main',
plugins: [
[
'@semantic-release/github',
{
assets: [
{ path: 'dist/**', label: 'Distribution Files' },
{ path: 'docs/**', label: 'Documentation' },
],
successComment: false,
},
],
[
'@semantic-release/npm',
{
npmPublish: false,
},
],
],
tagFormat: '${version}',
verifyConditions: [],
prepare: [],
};
In this configuration, you can access the name of the repository by using the ${pkg.name}
variable in the tagFormat
property. This will automatically replace the variable with the name of the repository defined in the package.json
file.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-07-17 17:14:41 +0000
Seen: 16 times
Last updated: Jul 17 '23