fix: panic on regex in main.workflow

fixes #12
This commit is contained in:
Casey Lee
2019-01-18 13:28:53 -08:00
parent 36303ce43d
commit a04141c444
4 changed files with 56 additions and 30 deletions

View File

@@ -128,11 +128,11 @@ func (runner *runnerImpl) applyEnvironment(env map[string]string) {
env["GITHUB_REPOSITORY"] = repo
}
branch, err := common.FindGitBranch(repoPath)
ref, err := common.FindGitRef(repoPath)
if err != nil {
log.Warningf("unable to get git branch: %v", err)
log.Warningf("unable to get git ref: %v", err)
} else {
env["GITHUB_REF"] = fmt.Sprintf("refs/heads/%s", branch)
env["GITHUB_REF"] = ref
}
}