Skip to content

Commit

Permalink
Rubocop lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bermannoah committed Oct 10, 2024
1 parent f788a3f commit 32f6411
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/github_check_run_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def update_check_payload(annotations)
output: {
title: CHECK_NAME,
summary: @summary,
annotations: annotations
annotations:
}
}
end
Expand Down
19 changes: 12 additions & 7 deletions lib/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@
require "net/http"
require "json"
require "time"
require_relative "./report_adapter"
require_relative "./github_check_run_service"
require_relative "./github_client"
require_relative "report_adapter"
require_relative "github_check_run_service"
require_relative "github_client"

def read_json(path)
JSON.parse(File.read(path))
end

project_path = ENV["PROJECT_PATH"].nil? ? ENV["GITHUB_WORKSPACE"] : "#{ENV['GITHUB_WORKSPACE']}/#{ENV['PROJECT_PATH']}"
project_path = if ENV["PROJECT_PATH"].nil?
ENV.fetch("GITHUB_WORKSPACE",
nil)
else
"#{ENV.fetch('GITHUB_WORKSPACE', nil)}/#{ENV['PROJECT_PATH']}"
end

@event_json = read_json(ENV["GITHUB_EVENT_PATH"]) if ENV["GITHUB_EVENT_PATH"]
@github_data = {
sha: ENV["GITHUB_SHA"],
latest_commit_sha: ENV["GITHUB_LATEST_SHA"],
token: ENV["GITHUB_TOKEN"],
sha: ENV.fetch("GITHUB_SHA", nil),
latest_commit_sha: ENV.fetch("GITHUB_LATEST_SHA", nil),
token: ENV.fetch("GITHUB_TOKEN", nil),
owner: ENV["GITHUB_REPOSITORY_OWNER"] || @event_json.dig("repository", "owner", "login"),
repo: ENV["GITHUB_REPOSITORY_NAME"] || @event_json.dig("repository", "name"),
pull_request_number: ENV["GITHUB_PULL_REQUEST_NUMBER"] || @event_json.dig("pull_request", "number"),
Expand Down

0 comments on commit 32f6411

Please sign in to comment.