diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 3921b389969..d55a53bd6e8 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -556,7 +556,7 @@ module Ci { key: 'CI_JOB_NAME', value: name, public: true }, { key: 'CI_JOB_STAGE', value: stage, public: true }, { key: 'CI_JOB_TOKEN', value: token, public: false }, - { key: 'CI_COMMIT_REF', value: sha, public: true }, + { key: 'CI_COMMIT_SHA', value: sha, public: true }, { key: 'CI_COMMIT_REF_NAME', value: ref, public: true }, { key: 'CI_COMMIT_REF_SLUG', value: ref_slug, public: true }, { key: 'CI_REGISTRY_USER', value: CI_REGISTRY_USER, public: true }, diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index ec3493776e8..4c3e7c4e86e 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -38,7 +38,7 @@ version of Runner required. | **CI_BUILD_ID** | all | all | The unique id of the current job that GitLab CI uses internally. Deprecated, use CI_JOB_ID | | **CI_JOB_ID** | 9.0 | all | The unique id of the current job that GitLab CI uses internally | | **CI_BUILD_REF** | all | all | The commit revision for which project is built. Deprecated, use CI_COMMIT_REF | -| **CI_COMMIT_REF** | 9.0 | all | The commit revision for which project is built | +| **CI_COMMIT_SHA** | 9.0 | all | The commit revision for which project is built | | **CI_BUILD_TAG** | all | 0.5 | The commit tag name. Present only when building tags. Deprecated, use CI_COMMIT_TAG | | **CI_COMMIT_TAG** | 9.0 | 0.5 | The commit tag name. Present only when building tags. | | **CI_BUILD_NAME** | all | 0.5 | The name of the job as defined in `.gitlab-ci.yml`. Deprecated, use CI_JOB_NAME | @@ -84,7 +84,7 @@ Example values: ```bash export CI_JOB_ID="50" -export CI_COMMIT_REF="1ecfd275763eff1d6b4844ea3168962458c9f27a" +export CI_COMMIT_SHA="1ecfd275763eff1d6b4844ea3168962458c9f27a" export CI_COMMIT_REF_NAME="master" export CI_REPOSITORY="https://gitab-ci-token:abcde-1234ABCD5678ef@example.com/gitlab-org/gitlab-ce.git" export CI_COMMIT_TAG="1.0.0" diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 18368de060c..fd6ea2d6722 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1293,7 +1293,7 @@ describe Ci::Build, :models do { key: 'CI_JOB_NAME', value: 'test', public: true }, { key: 'CI_JOB_STAGE', value: 'test', public: true }, { key: 'CI_JOB_TOKEN', value: build.token, public: false }, - { key: 'CI_COMMIT_REF', value: build.sha, public: true }, + { key: 'CI_COMMIT_SHA', value: build.sha, public: true }, { key: 'CI_COMMIT_REF_NAME', value: build.ref, public: true }, { key: 'CI_COMMIT_REF_SLUG', value: build.ref_slug, public: true }, { key: 'CI_PROJECT_ID', value: project.id.to_s, public: true },