Skip to content

Commit 4919025

Browse files
committedFeb 1, 2025
ci: add feature type to changelog
1 parent 942949f commit 4919025

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

Diff for: ‎scripts/generate_changelog.lua

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ local function get_changes(format, latest_tag)
2323
if format == 'md' then
2424
commit_format = '[%h](https://github.com/nvim-orgmode/orgmode/commit/%h)'
2525
end
26+
local feature_format = format == 'md' and '**%s**' or '*%s*'
2627

2728
local commits = vim.fn.systemlist(("git log %s..master --pretty=format:'%%s (%s)'"):format(latest_tag, commit_format))
2829
local fixes = {}
@@ -32,8 +33,11 @@ local function get_changes(format, latest_tag)
3233
for _, commit in ipairs(commits) do
3334
local type = commit:match('^(.-):')
3435
if type then
35-
type = type
36+
local feature = type:match('%((.-)%)')
3637
local message = vim.trim(commit:sub(#type + 2))
38+
if feature then
39+
message = ('%s: %s'):format(feature_format:format(feature), message)
40+
end
3741
if vim.endswith(type, '!') then
3842
table.insert(breaking_changes, message)
3943
elseif vim.startswith(type, 'fix') then

0 commit comments

Comments
 (0)