Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Fix branch name detection for GitHub Actions CI #111

Conversation

LocoDelAssembly
Copy link
Contributor

This pull request fixes two problems, expecting GITHUB_REF to contain 'head' instead of 'heads' and also not detecting empty string in GITHUB_HEAD_REF as falsey.

Without this patch all my commits were considered as being coming from the default branch. I required all fixes to make it work, including GITHUB_HEAD_REF issue as GitHub was providing me an empty string instead of leaving the variable undefined (verified with code below):

    steps:
    - name: Debug codecov
      run: |
        ruby -e '["GITHUB_REF", "GITHUB_HEAD_REF", "GITHUB_SHA", "GITHUB_REPOSITORY", "GITHUB_RUN_ID"].each { |v| puts "#{v}: #{ENV[v].inspect}" }'

@codecov
Copy link

codecov bot commented Nov 19, 2020

Codecov Report

Merging #111 (575145c) into master (0546624) will decrease coverage by 1.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
- Coverage   91.71%   90.52%   -1.19%     
==========================================
  Files           1        1              
  Lines         338      359      +21     
==========================================
+ Hits          310      325      +15     
- Misses         28       34       +6     
Impacted Files Coverage Δ
lib/codecov.rb 90.52% <100.00%> (-1.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0546624...575145c. Read the comment docs.

@thomasrockhu thomasrockhu self-requested a review November 24, 2020 13:41
Copy link
Contributor

@thomasrockhu thomasrockhu left a comment

Choose a reason for hiding this comment

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

@thomasrockhu thomasrockhu merged commit f677699 into codecov:master Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants