This repository was archived by the owner on Jan 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,9 +192,13 @@ def build_params(ci)
192192 when GITHUB
193193 # https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables
194194 params [ :service ] = 'github-actions'
195- params [ :branch ] = ENV [ 'GITHUB_HEAD_REF' ] || ENV [ 'GITHUB_REF' ] . sub ( 'refs/head/' , '' )
196- # PR refs are in the format: refs/pull/7/merge for pull_request events
197- params [ :pr ] = ENV [ 'GITHUB_REF' ] . split ( '/' ) [ 2 ] unless ENV [ 'GITHUB_HEAD_REF' ] . nil? || ENV [ 'GITHUB_HEAD_REF' ] . empty?
195+ if ( ENV [ 'GITHUB_HEAD_REF' ] || '' ) . empty?
196+ params [ :branch ] = ENV [ 'GITHUB_REF' ] . sub ( 'refs/heads/' , '' )
197+ else
198+ params [ :branch ] = ENV [ 'GITHUB_HEAD_REF' ]
199+ # PR refs are in the format: refs/pull/7/merge for pull_request events
200+ params [ :pr ] = ENV [ 'GITHUB_REF' ] . split ( '/' ) [ 2 ]
201+ end
198202 params [ :slug ] = ENV [ 'GITHUB_REPOSITORY' ]
199203 params [ :build ] = ENV [ 'GITHUB_RUN_ID' ]
200204 params [ :commit ] = ENV [ 'GITHUB_SHA' ]
Original file line number Diff line number Diff line change @@ -484,8 +484,8 @@ def test_github_pull_request
484484 def test_github_push
485485 ENV [ 'CI' ] = 'true'
486486 ENV [ 'GITHUB_ACTIONS' ] = 'true'
487- ENV [ 'GITHUB_HEAD_REF' ] = nil
488- ENV [ 'GITHUB_REF' ] = 'refs/head /master'
487+ ENV [ 'GITHUB_HEAD_REF' ] = ''
488+ ENV [ 'GITHUB_REF' ] = 'refs/heads /master'
489489 ENV [ 'GITHUB_REPOSITORY' ] = 'codecov/ci-repo'
490490 ENV [ 'GITHUB_RUN_ID' ] = '1'
491491 ENV [ 'GITHUB_SHA' ] = 'c739768fcac68144a3a6d82305b9c4106934d31a'
You can’t perform that action at this time.
0 commit comments