Skip to content

Commit

Permalink
Merge pull request #29 from mohsinulhaq/master
Browse files Browse the repository at this point in the history
fix branch returning incorrect value for GitHub Actions
  • Loading branch information
kuldeepkeshwar authored Nov 2, 2019
2 parents c973b6f + 5d0871a commit 641da79
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ if (process.env.TRAVIS) {

event = 'push'
pull_request_number = process.env.CI_PR_NUMBER
sha=process.env.CI_COMMIT_ID,
sha=process.env.CI_COMMIT_ID,
buildUrl=process.env.CI_BUILD_URL

ci = 'codeship'
} else if (process.env.GITHUB_ACTION) {
// GitHub Actions
Expand All @@ -79,7 +79,8 @@ if (process.env.TRAVIS) {
event = process.env.GITHUB_EVENT_NAME
commit_message = ''
pull_request_number = ''
branch = process.env.GITHUB_REF
// GITHUB_HEAD_REF for pull requests. For commits, GITHUB_REF is of the form refs/heads/master, for example
branch = process.env.GITHUB_HEAD_REF || process.env.GITHUB_REF && process.env.GITHUB_REF.split('/')[2]
ci = 'github_actions'
} else if (process.env.NETLIFY) {
// Reference: https://www.netlify.com/docs/continuous-deployment/#environment-variables
Expand Down

0 comments on commit 641da79

Please sign in to comment.