0

.gitlab-ci.yml file includes another .yml file:

    include:
      - project: "test_repository"
        ref: "develop"
        file: "template.yml"

While pipeline execution 'template.yml' is taken from HEAD of 'develop' branch in 'test_repository'. Is it possible get 'template.yml' commit somehow after or while the pipeline execution?

torek
  • 448,244
  • 59
  • 642
  • 775
Serhiy
  • 21
  • 6
  • You could use curl to query the gitlab api for the commit of the repo. – Chris Sep 17 '21 at 13:08
  • As long as `git` is available in the image you use (assuming you're using the Docker executor for your runners), you could always [checkout the file from another branch](https://stackoverflow.com/q/2364147/2307873). – Adam Marshall Sep 17 '21 at 14:31
  • Want to have some universal solution, because have more than 10 repositories with different includes. I thought that it should be some record in a job logs or some system variable with commit, but I did not find it. – Serhiy Sep 17 '21 at 15:45

0 Answers0