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

fix: correct branch name for Github Actions #16

Merged
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion spec/coverage_reporter/config_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ Spectator.describe CoverageReporter::Config do
ENV["GITHUB_REPOSITORY"] = "owner/repo"
ENV["GITHUB_RUN_ID"] = "12345"
ENV["GITHUB_JOB"] = "test"
ENV["GITHUB_REF_NAME"] = "fix/bug"
ENV["GITHUB_REF_NAME"] = "main"
ENV["GITHUB_HEAD_REF"] = "fix/bug"
ENV["GITHUB_SHA"] = "github-commit-sha"
end

Expand Down
2 changes: 1 addition & 1 deletion src/coverage_reporter/ci/github.cr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module CoverageReporter
repo_name: ENV["GITHUB_REPOSITORY"]?,
service_number: ENV["GITHUB_RUN_ID"]?,
service_job_id: ENV["GITHUB_JOB"]?,
service_branch: ENV["GITHUB_REF_NAME"]?,
service_branch: ENV["GITHUB_HEAD_REF"]? || ENV["GITHUB_REF_NAME"]?,
service_build_url: build_url,
commit_sha: ENV["GITHUB_SHA"]?,
).to_h
Expand Down