Skip to content

Commit

Permalink
remove unneeded config
Browse files Browse the repository at this point in the history
  • Loading branch information
brianberlin committed Oct 2, 2023
1 parent 83b11e7 commit 7bd86f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
9 changes: 0 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ inputs:
description: 'Github token of the repository (automatically created by Github)'
default: ${{ github.token }}
required: false
pull_number:
required: true
description: 'Pull Request Number'
repository:
required: true
description: 'Repository Name'
head_branch:
required: true
description: 'Head Branch'
coverage_threshold:
required: true
description: 'Coverage Threshold'
Expand Down
17 changes: 12 additions & 5 deletions lib/coverage_reporter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -378,13 +378,20 @@ defmodule CoverageReporter do
end
end

defp pull_number, do: System.get_env("INPUT_PULL_NUMBER")
defp head_branch, do: System.get_env("INPUT_HEAD_BRANCH")
defp repository, do: System.get_env("INPUT_REPOSITORY")
defp coverage_threshold, do: "INPUT_COVERAGE_THRESHOLD" |> System.get_env("80") |> String.to_integer()
defp lcov_path, do: System.get_env("INPUT_LCOV_PATH")
defp head_branch, do: System.get_env("GITHUB_HEAD_REF")
defp repository, do: System.get_env("GITHUB_REPOSITORY")
defp github_workspace, do: System.get_env("GITHUB_WORKSPACE")
defp pull_number, do: System.get_env("INPUT_PULL_NUMBER")
defp github_token, do: System.get_env("INPUT_GITHUB_TOKEN")
defp github_api_url, do: System.get_env("GITHUB_API_URL")
defp coverage_threshold, do: "INPUT_COVERAGE_THRESHOLD" |> System.get_env("80") |> String.to_integer()

defp pull_number do
github_ref = System.get_env("GITHUB_REF") |> String.split("/")

case github_ref do
["refs", "pull", pr_number, "merge"] -> pr_number
_ -> raise "Could not find pull request number."
end
end
end

0 comments on commit 7bd86f0

Please sign in to comment.