Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,19 @@ task 'coverage' do
task.invoke
end

# Regenerate CHANGELOG.md from the commit history with git-cliff
# (https://git-cliff.org; `brew install git-cliff`). Run after merging PRs to
# refresh [Unreleased]; pass the release tag to finalize a version section:
# rake "changelog[v12.0.0.beta.7]"
desc 'Regenerate CHANGELOG.md from commits (git-cliff)'
task :changelog, [:tag] do |_task, args|
cmd = %w[git cliff]
if (tag = args[:tag])
tag.match?(/\Av\d[\w.-]*\z/) or raise "Invalid tag #{tag.inspect} (expected e.g. v12.0.0.beta.7)" # rubocop:disable Style/AndOr
cmd += ['--tag', tag]
end
# Pass args to sh as an array — no shell, so the tag can't inject commands.
sh(*cmd, '-o', 'CHANGELOG.md')
end

task default: ['spec']
Loading