gitlabgitlab-ci

How can I get the commit diff in Gitlab CI?


I use Gitlab CI for checking a code quality of my project. Sometime I want to check only new code ( new commit ).
How can I get diff from Gitlab CI ?


Solution

  • I found out solution, it was obvious, but not for me

     diff:
       script:
         - git diff ${CI_COMMIT_SHA} master
       except:
         - master