Fetch commit history list, supports exporting commit list JSON data to a file.
push, branch.createtag_pushpull_request, pull_request.target, pull_request.mergeable, pull_request.mergedtoFile: Optional, output commit list to a file, defaults to commit-list.json.tagFormat: Optional, in tag_push, filter the previous tag that matches the specified format and compare it with the current tag. The current tag must match the tagFormat. Defaults to *.main:
push:
- stages:
- name: git-commit-list
image: tencentcom/git-commit-list:latest
settings:
# Optional, output commit list to a file
toFile: commit-list.json
pull_request:
- stages:
- name: git-commit-list
image: tencentcom/git-commit-list:latest
settings:
# Optional, output commit list to a file
toFile: commit-list.json
$:
tag_push:
- stages:
- name: git-commit-list
image: tencentcom/git-commit-list:latest
settings:
# Optional, filter the previous tag that matches the v* format
tagFormat: v*
# Optional, output commit list to a file
toFile: commit-list.json
[
{
"id": "ee0738cc39660baa47e08b6ef3b9f942165d1a0a",
"short_id": "ee0738cc",
"author_name": "name",
"author_email": "name@xxx.com",
"create_at": "2022-11-24T16:26:48+08:00",
"message": "fix: Fetch commit history list\n\n#123",
"title": "fix: Fetch commit history list"
}
]
Push Event
docker run --rm \ -e TZ=Asia/Shanghai \ # Event name -e CNB_EVENT="push" \ # Commit ID before this commit -e CNB_BEFORE_SHA="xxx" \ # Latest commit ID -e CNB_COMMIT="xxx" \ # Relative path to the file for storing commit list JSON data -e PLUGIN_TOFILE="commit-list.json" \ -v $(pwd):$(pwd) \ -w $(pwd) \ tencentcom/git-commit-list:latest
PR Event
docker run --rm \ -e TZ=Asia/Shanghai \ # Event name -e CNB_EVENT="pull_request" \ # Source branch name of the MR -e CNB_PULL_REQUEST_BRANCH="xxx" \ # Target branch name of the MR -e CNB_BRANCH="master" \ # Latest commit ID -e CNB_COMMIT="xxx" \ # Relative path to the file for storing commit list JSON data -e PLUGIN_TOFILE="commit-list.json" \ -v $(pwd):$(pwd) \ -w $(pwd) \ tencentcom/git-commit-list:latest