...
 
Commits (5)
......@@ -145,6 +145,10 @@ func (c *GitLabCiYamlParser) prepareSteps(job *common.JobResponse) (err error) {
}
func (c *GitLabCiYamlParser) buildDefaultVariables(job *common.JobResponse) (defaultVariables common.JobVariables, err error) {
shortSha := ""
if len(job.GitInfo.Sha) > 8 {
shortSha = job.GitInfo.Sha[0:8]
}
defaultVariables = common.JobVariables{
{Key: "CI", Value: "true", Public: true, Internal: true, File: false},
{Key: "GITLAB_CI", Value: "true", Public: true, Internal: true, File: false},
......@@ -158,6 +162,7 @@ func (c *GitLabCiYamlParser) buildDefaultVariables(job *common.JobResponse) (def
{Key: "CI_JOB_TOKEN", Value: job.Token, Public: true, Internal: true, File: false},
{Key: "CI_REPOSITORY_URL", Value: job.GitInfo.RepoURL, Public: true, Internal: true, File: false},
{Key: "CI_COMMIT_SHA", Value: job.GitInfo.Sha, Public: true, Internal: true, File: false},
{Key: "CI_COMMIT_SHORT_SHA", Value: shortSha, Public: true, Internal: true, File: false},
{Key: "CI_COMMIT_BEFORE_SHA", Value: job.GitInfo.BeforeSha, Public: true, Internal: true, File: false},
{Key: "CI_COMMIT_REF_NAME", Value: job.GitInfo.Ref, Public: true, Internal: true, File: false},
}
......