diff --git a/lib/relaton/logger/channels/gh_issue.rb b/lib/relaton/logger/channels/gh_issue.rb index c28edca..ef46fe3 100644 --- a/lib/relaton/logger/channels/gh_issue.rb +++ b/lib/relaton/logger/channels/gh_issue.rb @@ -67,7 +67,9 @@ def issue_body def headers { "Content-Type" => "application/json", - "Authorization" => "token #{ENV['GITHUB_TOKEN']}", + "Accept" => "application/vnd.github+json", + "Authorization" => "Bearer #{ENV['GITHUB_TOKEN']}", + "X-GitHub-Api-Version" => "2022-11-28", } end end diff --git a/lib/relaton/logger/version.rb b/lib/relaton/logger/version.rb index fbc66bc..761bca1 100644 --- a/lib/relaton/logger/version.rb +++ b/lib/relaton/logger/version.rb @@ -2,6 +2,6 @@ module Relaton module Logger - VERSION = "0.2.1" + VERSION = "0.2.2" end end diff --git a/spec/relaton/logger/channels/gh_issue_spec.rb b/spec/relaton/logger/channels/gh_issue_spec.rb index 75017be..e9faa89 100644 --- a/spec/relaton/logger/channels/gh_issue_spec.rb +++ b/spec/relaton/logger/channels/gh_issue_spec.rb @@ -68,6 +68,11 @@ it "headers" do expect(ENV).to receive(:[]).with("GITHUB_TOKEN").and_return("token").twice - expect(subject.send :headers).to eq({ "Content-Type" => "application/json", "Authorization" => "token token" }) + expect(subject.send :headers).to eq({ + "Content-Type" => "application/json", + "Accept" => "application/vnd.github+json", + "Authorization" => "Bearer token", + "X-GitHub-Api-Version" => "2022-11-28", + }) end end