Check the number of commits and code changes in MR (Merge Request).
Type: Number
Maximum number of commits allowed in a single MR
Type: Number
Maximum number of code changes in a single MR, including additions, deletions, and modifications
Type: String | String[]
Files or folders to ignore when checking line changes (relative paths, e.g., test)
Type: String | String[]
Files or folders to include when checking line changes (relative paths, e.g., src)
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
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