logo
0
0
WeChat Login

git-pr-limit

Check the number of commits and code changes in pull_request.

Input

maxCommitCount

Type: Number

Maximum number of commits allowed in a single pull_request

maxCommitLine

Type: Number

Maximum number of code changes in a single pull_request, 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="" \

  cnbcool/git-pr-limit

Usage with Cloud Native Build

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

About

No description, topics, or website provided.
144.00 KiB
0 forks0 stars2 branches2 TagREADMEMIT license
Language
TypeScript69.6%
JavaScript16.1%
Shell9.8%
Dockerfile4.5%