Skip to content

Add Token Location to Verbose Output #1048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
12 changes: 11 additions & 1 deletion lib/github_changelog_generator/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down