Retrieving push metainformation and transferring it to the CI

34 views Asked by At

I know, that in general GitLab CI scripts run after every push to the repository. How I can retrieve metainforation about the push and then transfer it to the GitLab CI?

By metainforation I mean:

  • project name,
  • name of the user, who performed this push,
  • name of the branch (branches) affected by push.
1

There are 1 answers

0
Stefan van Gastel On BEST ANSWER

You can find an overview of variables available in the CI here: https://docs.gitlab.com/ee/ci/variables/#predefined-variables-environment-variables.

E.g.:

  • CI_COMMIT_REF_NAME | The branch or tag name for which project is built
  • CI_PROJECT_NAME | The project name that is currently being built (actually it is project folder name)
  • GITLAB_USER_ID | The id of the user who started the job
  • GITLAB_USER_EMAIL | The email of the user who started the job