Generate changelog based on historical commit information between two versions. By default, it will be generated to the
CHANGELOG.md file in the working directory.
Note:
branch.delete eventsThe tag used to generate the changelog (get changes between previousTag | previousBranch and tag to generate the
changelog)
The previous version tag used to generate the changelog, with higher priority than previousBranch.
If provided, the changelog is generated from changes between previousTag and tag;
If not provided, the changelog is generated from changes between tag and the previous tag
The previous version (branch name) used to generate the changelog.
If provided, the changelog is generated from changes between previousBranch and tag;
If not provided, the changelog is generated from changes between tag and the previous tag
Used to generate the changelog written to the target file. If provided, the log is generated starting from the from
version; otherwise, it starts from the first version
Modify the file path for generating logs. This field is invalid when dryRun: true or day: xxx is set.
The starting version of the log written to the file is from. If from does not exist, it starts from the first version.
Not affected by tag and previousTag.
Specify the file path for the latest changelog (changes between previousTag and tag). This field is invalid when dryRun: true or day is set.
Only generate and directly return the changelog from the previous version to now
(If previousTag and tag are provided, generate the changelog between these two), content is in the output result;
If this field is set, the log will not be written to a file, i.e., the target field is invalid. And day is invalid
Get a summary of commits in the recent period, content is in the output result
If this field is set, the log will not be written to a file, i.e., the target field is invalid. And tag and
previousTag are invalid
Whether to discard some commits, only keeping those that have version change impacts in semantic versioning
Whether to display associated links, including commits and issues, etc.
Whether to identify and display issue IDs, supports identifying the #123 format
Whether to identify and display PR IDs. Supports identifying the PR-URL: #123 format
Whether to display the code commit time
{
latestChangeLog, // The latest changelog
}
docker run --rm -t -v $(pwd):$(pwd) -w $(pwd) cnbcool/changelog .
Generate CHANGELOG.md file:
# .cnb.yml
$:
tag_push:
- stages:
- name: changelog
image: cnbcool/changelog
- name: showfile
script: ls -al CHANGELOG.md
Export as a variable and send to a group:
# .cnb.yml
$:
tag_push:
- stages:
- name: Generate changelog
image: cnbcool/changelog
settings:
dryRun: true
linkReferences: false
exports:
latestChangeLog: RELEASE_NOTES
- name: Echo changelog
script: echo "$RELEASE_NOTES"
- name: Send to enterprise group
image: tencentcom/wecom-message
settings:
robot: your-bot-xxxxxxx
content: |
## ChangeLog
$RELEASE_NOTES
Automatically generate weekly reports at 3 PM every Friday:
# .cnb.yml
$:
# At 3 PM every Friday
"crontab: 0 15 * * 5":
- stages:
- name: week changelog
image: cnbcool/changelog
settings:
day: 7
dryRun: true
linkReferences: false
exports:
latestChangeLog: WEEK_REPORT
- name: wework notice
image: tencentcom/wecom-message
settings:
robot: your-bot-xxxxxxx
content: |
## ChangeLog
$WEEK_REPORT
Use latestChangeLogTarget to write the changelog between the current tag and the previous tag to a custom file:
# .cnb.yml
$:
tag_push:
- stages:
- name: Generate changelog
image: cnbcool/changelog
settings:
latestChangeLogTarget: LATEST_CHANGELOG.md
- name: Show latest changelog
script: cat LATEST_CHANGELOG.md