Skip to content

Commit

Permalink
core: Correctly remove '/refs/head/' prefix in Github ref for Code Cl…
Browse files Browse the repository at this point in the history
…imate.
  • Loading branch information
paambaati committed Oct 31, 2019
1 parent a24677c commit 578f402
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ function prepareEnv() {
if (process.env.GITHUB_SHA !== undefined)
env.GIT_COMMIT_SHA = process.env.GITHUB_SHA;
if (process.env.GITHUB_REF !== undefined)
env.GIT_BRANCH = process.env.GITHUB_REF.replace(/^refs\/head\//, ''); // Remove 'refs/head/' prefix (See https://github.com/paambaati/codeclimate-action/issues/42)
env.GIT_BRANCH = process.env.GITHUB_REF;

env.GIT_BRANCH = env.GIT_BRANCH.replace(/^refs\/head\//, ''); // Remove 'refs/head/' prefix (See https://github.com/paambaati/codeclimate-action/issues/42)
return env;
}

Expand Down

0 comments on commit 578f402

Please sign in to comment.