Skip to content
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

Support Github Actions with Codecov #288

Merged
merged 1 commit into from
Nov 17, 2020
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
18 changes: 17 additions & 1 deletion src/codecovio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,26 @@ module Codecov
build = ENV["BUILD_BUILDID"],
)
elseif haskey(ENV, "GITHUB_ACTION") # GitHub Actions
ref = ENV["GITHUB_REF"]
if startswith(ref, "refs/heads/")
branch = ref[12:end]
ga_pr = "false"
elseif startswith(ref, "refs/tags/")
branch = ref[11:end]
ga_pr = "false"
elseif startswith(ref, "refs/pull/")
branch = ENV["GITHUB_HEAD_REF"]
ga_pr = first(split(ref[11:end], "/"))
end
ga_build_url = "https://github.com/$(ENV["GITHUB_REPOSITORY"])/actions/runs/$(ENV["GITHUB_RUN_ID"])"
kwargs = set_defaults(kwargs,
service = "custom",
service = "github-actions",
branch = branch,
commit = ENV["GITHUB_SHA"],
pull_request = ga_pr,
slug = ENV["GITHUB_REPOSITORY"],
build = ENV["GITHUB_RUN_ID"],
build_url = ga_build_url,
)
else
error("No compatible CI platform detected")
Expand Down