Skip to content

Commit b1e2ea0

Browse files
committed
Add a dummy changelog rake task when the bundle is not complete
Some parts of CI run with a bundle without the packaging gems, we should not raise an error if the github_changelog_generator gem is not found, but rather tell how to fix that when the task is called.
1 parent 1ed7284 commit b1e2ea0

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

Rakefile

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,24 @@ if Rake.application.top_level_tasks.grep(/^gettext:/).any?
147147
end
148148
end
149149

150-
require "github_changelog_generator/task"
151-
require_relative "lib/puppet/version"
150+
begin
151+
require "github_changelog_generator/task"
152+
require_relative "lib/puppet/version"
152153

153-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
154-
config.header = <<~HEADER.chomp
154+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
155+
config.header = <<~HEADER.chomp
155156
# Changelog
156157
157158
All notable changes to this project will be documented in this file.
158-
HEADER
159-
config.user = "openvoxproject"
160-
config.project = "puppet"
161-
config.exclude_labels = %w[dependencies duplicate question invalid wontfix wont-fix modulesync skip-changelog]
162-
config.since_tag = "8.18.1"
163-
config.future_release = Puppet::PUPPETVERSION
159+
HEADER
160+
config.user = "openvoxproject"
161+
config.project = "puppet"
162+
config.exclude_labels = %w[dependencies duplicate question invalid wontfix wont-fix modulesync skip-changelog]
163+
config.since_tag = "8.18.1"
164+
config.future_release = Puppet::PUPPETVERSION
165+
end
166+
rescue LoadError
167+
task :changelog do
168+
abort("Run `bundle install --with packaging` to install the `github_changelog_generator` gem.")
169+
end
164170
end

0 commit comments

Comments
 (0)