I am using predefined variables like $CI_COMMIT_REF_SLUG
in my gitlab ci pipeline and it would be very useful to access those variables via the gitlab api.
I have read through the documentation and went through all gitlab-ci related GET routes (branches/, jobs/, pipelines/) but could only find the original branch names/tags for each job and pipeline.
Is there any to access this variable?
edit:
Use-case would be I'd like to query the urls after a successful pipeline.
During the pipeline a url like this is generated example.com/$_CI_COMMIT_REF_SLUG/
.
I need a response like this coming from the API:
{
"ref_slug":"foo-12",
"ref":"-/foo_12-"
}