Fix commit status API creating branch pipeline even when ref is tag
What does this MR do and why?
Fix commit status API creating branch pipeline even when ref is tag
References
Screenshots or screen recordings
| Before | After |
|---|---|
| N / A | N / A |
How to set up and validate locally
- Checkout this branch and run gdk locally
- Create a new personal access token and copy/paste it somewhere to use in step 4
- Go to any project that has few commits and create a new tag from main branch eg
v.2.2.2 - Call the commits status api to set the status for commit SHA
- call the POST commits status api eg: http://127.0.0.1:3000/api/v4/projects/PROJECT_ID/statuses/COMMIT_SHA
- with header
PRIVATE-TOKENset to your newly created personal access token - with body
{ "state": "success", "ref": "v2.2.2" }- make sure tagv2.2.2exists
- Opens rails console with
rails consolecommand - Check the newly created pipeline with
pipeline = Ci::Pipeline.order(created_at: :desc).first - Notice the
tagproperty is properly set totruenow - Compare to master branch where it was always set to false
Edited by Rinku C