# Predefined variables
# All variables
The following predefined variables are available for all jobs.
Name | Description | Example |
---|---|---|
CI_GIT_PROVIDER | The scm provider | github |
CI_REPOSITORY | The repository currently being built | sun-ci/example |
CI_BUILD_NUMBER | The unique ID of current build | 1 |
CI_BUILD_ID | The current build number, specific to current project | 123 |
CI_JOB_ID | The unique ID of current job | 123 |
CI_JOB_NAME | The name of current job | build |
CI_JOB_STAGE | The current stage being executed | build |
CI_BUILD_TRIGGER | The event that triggered the build | webhook , manual |
CI_WEBHOOK_EVENT | The webhook event sent by the scm provider | pull_request |
CI_WEBHOOK_ACTION | The webhook action sent by the scm provider | opened |
CI_BRANCH | The branch currently being build | master |
CI_COMMIT_SHA | The SHA of the commit currently being build | 3b43d7c3c8e169c8e29f650f8b092801555fa9c2 |
CI_COMMIT_MESSAGE | The message of the commit currently being built | Fix some bug |
CI_COMMIT_REF | The git ref of the commit currently being build | refs/heads/master |
CI_COMMIT_AUTHOR | The user who authored the commit | your_github_username |
# Usage in config values
Beside using in job script, The following configs also allow using predefined variables in its value:
# Cache
jobs:
build:
image: node:12-alpine
script:
- npm install
- npm run build
cache:
- key: node_modules_$CI_BRANCH
paths:
- node_modules