diff --git a/lib/github_changelog_generator/options.rb b/lib/github_changelog_generator/options.rb index b77503fa..d75ca771 100644 --- a/lib/github_changelog_generator/options.rb +++ b/lib/github_changelog_generator/options.rb @@ -145,7 +145,17 @@ def values # # @return [Hash] The GitHub `:token` key is censored in the output. def censored_values - values.clone.tap { |opts| opts[:token] = opts[:token].nil? ? "No token used" : "hidden value" } + values.clone.tap { |opts| opts[:token] = censored_token(opts[:token]) } + end + + def censored_token(opts_token) + if !opts_token.nil? + "Used token from options" + elsif ENV["CHANGELOG_GITHUB_TOKEN"] + "Used token from environment variable" + else + "No token used" + end end def unsupported_options