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

Expand on data extraction from github action runs for Coveralls #296

Merged
merged 2 commits into from
Nov 19, 2020
Merged
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions src/coveralls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,14 @@ module Coveralls
data["git"]["branch"] = split(ENV["GIT_BRANCH"], "/")[2]
end
elseif haskey(ENV, "GITHUB_ACTION")
data["service_job_id"] = ENV["GITHUB_RUN_ID"]
data["service_name"] = "github"
data["git"] = parse_git_info(git_info)

event_path = open(JSON.Parser.parse, ENV["GITHUB_EVENT_PATH"])
github_pr_info = get(event_path, "pull_request", Dict())
github_pr = get(github_pr_info, "number", "")
isempty(github_pr) || (data["service_pull_request"] = github_pr)
Comment on lines +109 to +112
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooooh, that's nice, I wasn't aware of it, else I would have suggested it for PR #288 -- I wonder if perhaps you or @kyungminlee would be interested in adjusting the Codecov code path to also parse the GITHUB_EVENT_PATH JSON. In general, we try to keep the Codecov and Coveralls support in sync (but I merged PR #288 anyway, because (a) I forgot 😨 and (b) honestly, I'd rather have something that works in now than to not have it at all because it's perfect...

Anyway: very nice 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I can do that.

Copy link
Contributor Author

@mfherbst mfherbst Nov 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit tricky to use in general though, because for push builds you don't have that much info it seems (like I could not find how to e.g. extract the branch name in a quick search).

See https://docs.github.com/en/free-pro-team@latest/rest/reference/pulls for PRs and https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#commits for push builds.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess one then needs to combine techniques from PR #288 and this one... Ah well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that's kind of what I did. Not sure that makes things a lot better, though.

else
data["git"] = parse_git_info(git_info)
end
Expand Down