logo
0
0
WeChat Login

git-mr-limit

Check the number of commits and code changes in MR (Merge Request).

Input

maxCommitCount

Type: Number

Maximum number of commits allowed in a single MR

maxCommitLine

Type: Number

Maximum number of code changes in a single MR, including additions, deletions, and modifications

exclude

Type: String | String[]

Files or folders to ignore when checking line changes (relative paths, e.g., test)

include

Type: String | String[]

Files or folders to include when checking line changes (relative paths, e.g., src)

Usage with Docker

docker run --rm -it \ -v $(pwd):$(pwd) -w $(pwd) \ # User input -e PLUGIN_MAXCOMMITCOUNT="10" \ -e PLUGIN_MAXCOMMITLINE="200" \ -e PLUGIN_EXCLUDE="test" \ -e PLUGIN_INCLUDE="src" \ # Get from CI environment variables # Event name -e CNB_EVENT="pull_request" \ # Target branch latest commitID -e CNB_PULL_REQUEST_TARGET_SHA="" \ # Source branch latest commitID -e CNB_PULL_REQUEST_SHA="" \ # Source branch name -e CNB_PULL_REQUEST_BRANCH="" \ # Target branch name -e CNB_BRANCH="" \ tencentcom/git-mr-limit

Usage with Cloud Native Build

main: pull_request: - stages: - name: MR Change Check image: tencentcom/git-mr-limit settings: maxCommitCount: 10 maxCommitLine: 200 exclude: - test - package-lock.json include: src

About

mr 变更检查

540.00 KiB
0 forks0 stars2 branches1 TagREADMEMIT license
Language
TypeScript66.1%
JavaScript20%
Shell9.5%
Dockerfile4.3%
Others0.1%