@maggioli-rd/sr-codeowners-plugin
Advanced tools
Comparing version 1.2.2 to 1.3.0
@@ -0,1 +1,13 @@ | ||
# [1.3.0](https://gitlab.com/maggiolispa/ricerca-sviluppo/semantic-release-shareable-configurations/sr-codeowners-plugin/compare/v1.2.2...v1.3.0) (2024-1-9) | ||
### Bug Fixes | ||
* add header checks in cmd build ([4d01028](https://gitlab.com/maggiolispa/ricerca-sviluppo/semantic-release-shareable-configurations/sr-codeowners-plugin/commit/4d0102818e95c311909a09477f78c7ee78885bc0)) | ||
### Features | ||
* add header plugin config ([3db10ee](https://gitlab.com/maggiolispa/ricerca-sviluppo/semantic-release-shareable-configurations/sr-codeowners-plugin/commit/3db10eec31504e184b2f966e8ec4c7435bfbf02f)) | ||
## [1.2.2](https://gitlab.com/maggiolispa/ricerca-sviluppo/semantic-release-shareable-configurations/sr-codeowners-plugin/compare/v1.2.1...v1.2.2) (2024-1-9) | ||
@@ -2,0 +14,0 @@ |
export type PluginConfig = { | ||
excludeRegex: string; | ||
header: string; | ||
codeownersPath: string; | ||
@@ -4,0 +5,0 @@ limit: number; |
const DEFAULT_CONFIG = { | ||
excludeRegex: "", | ||
header: "### CODEOWNERS file autogenerated using the Semantic Release plugin @maggioli-rd/sr-codeowners-plugin ###\n", | ||
codeownersPath: ".gitlab/CODEOWNERS", | ||
@@ -4,0 +5,0 @@ limit: 3, |
@@ -12,3 +12,3 @@ import SemanticReleaseError from "@semantic-release/error"; | ||
} | ||
await verifyCommand("which", ["git", "touch", "sed", "grep", "head"]); | ||
await verifyCommand("which", ["git", "touch", "sed", "grep", "head", "sort", "echo"]); | ||
}; | ||
@@ -15,0 +15,0 @@ const verifyCommand = async (command, args) => { |
@@ -5,12 +5,19 @@ import SemanticReleaseError from "@semantic-release/error"; | ||
export const verifyRelease = async (pluginConfig, { logger }) => { | ||
const { excludeRegex, codeownersPath, limit, leaderboard } = getConfig(pluginConfig); | ||
const { excludeRegex, header, codeownersPath, limit, leaderboard } = getConfig(pluginConfig); | ||
var cmd = "git shortlog -s -e -n --all |"; | ||
if (leaderboard == true) { | ||
logger.log("Set " + leaderboard + " as leaderboard"); | ||
cmd = "git shortlog -s -e -n --all | sed -e 's/^/# /' > " + codeownersPath + " && " + cmd; | ||
cmd = "git shortlog -s -e -n --all | sed -e 's/^/# /' >> " + codeownersPath + " && " + cmd; | ||
} | ||
else { | ||
cmd = "touch " + codeownersPath + " && " + cmd; | ||
logger.log("Skip leaderboard!"); | ||
} | ||
if (header.length != 0) { | ||
logger.log("Set " + header + " as header"); | ||
cmd = "echo '" + header + "' > " + codeownersPath + " && " + cmd; | ||
} | ||
else { | ||
logger.log("Skip header!"); | ||
cmd = "touch " + codeownersPath + " && " + cmd; | ||
} | ||
if (excludeRegex.length != 0) { | ||
@@ -17,0 +24,0 @@ logger.log("Set " + excludeRegex + " as excludeRegex"); |
{ | ||
"name": "@maggioli-rd/sr-codeowners-plugin", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "Maggioli Semantic Release Plugin: Codeowners", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -1,3 +0,24 @@ | ||
# Maggioli Semantic Release Plugin: Codeowners | ||
# @maggioli-rd/sr-codeowners-plugin | ||
[![npm next version](https://img.shields.io/npm/v/@maggioli-rd/sr-codeowners-plugin/latest.svg)](https://www.npmjs.com/package/@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 | | ||
## Links | ||
* [https://semantic-release.gitbook.io/semantic-release/](https://semantic-release.gitbook.io/semantic-release/) | ||
@@ -4,0 +25,0 @@ * [https://semantic-release.gitbook.io/semantic-release/developer-guide/plugin](https://semantic-release.gitbook.io/semantic-release/developer-guide/plugin) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13946
93
27