@maggioli-rd/sr-codeowners-plugin
v1.29.3
Published
Maggioli Semantic Release Plugin: Codeowners
Downloads
810
Readme
@maggioli-rd/sr-codeowners-plugin
| Step | Description |
|--------------------|--------------------------------------------------------------------------|
| verifyConditions
| Execute a shell command to verify if the CODEOWNERS file can be created. |
| verifyRelease
| Execute a shell command to create the CODEOWNERS file. |
Configuration
| Options | Description | Default |
|--------------------|-------------------------------------------------------------------------------------------------------------|----------------------------|
| excludeRegex
| RegEx to exclude authors when creating the CODEOWNERS file. | "" |
| header
| String inserted in the first line of the CODEOWNERS file as header. | Autogen comment (see code) |
| codeownersPath
| Path where to create the CODEOWNERS file. | .gitlab/CODEOWNERS |
| limit
| Number of authors obtained from the ranking of authors with the most commits. | 3 |
| leaderboard
| Generates the ranking of authors with the most commits and includes it as a comment in the CODEOWNERS file. | true |
Install
$ npm install @maggioli-rd/sr-codeowners-plugin -D
Usage
The plugin can be configured in the semantic-release configuration file:
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
["@semantic-release/git", {
"assets": [
"CHANGELOG.md",
"pubspec.yaml",
"CODEOWNERS"
],
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
}],
["@maggioli-rd/sr-codeowners-plugin", {
"excludeRegex": "semantic-release-bot",
"codeownersPath": "CODEOWNERS",
"limit": 2
}]
]
}
Shareable-Configuration Extension Example (release.config.js)
var config = require('@maggioli-rd/semantic-release-flutter');
var gitPluginIndex = config.plugins.findIndex((plugin) => plugin.includes("@semantic-release/git"))
config.plugins[gitPluginIndex][1]["assets"].push(".gitlab/CODEOWNERS")
config.plugins.push(
["@maggioli-rd/sr-codeowners-plugin", {
"excludeRegex": "RenovateBot|semantic-release-bot",
"limit": 5,
"header": "My personal header"
}]
)
module.exports = config