Get Hash of last successfull pipline run

Hello community,

I finally was able to register a runner for GitLab that handles python, latex and inkscape jobs for me.

Now I want to also add the latexdiff functions that creates a PDF which shows the difference between the current commit and one other.

My question is now, is it possible (it probably is) to get the git hash of the last successfull pipeline run of GitLab, so I can show the differences between most recent commit and this former one?

I appreciate any help that I could get.

Best,
Christoph