fix(ci run): use correct default branch
Description
glab ci run
does not pick correct git
branch - This MR is to fix and ensure glab ci run
is running against current branch if no branch
parameter set
Related Issues
Relates to #1380 (closed)
How has this been tested?
- Create a sample GitLab repo which contain more than 1 branch at https://gitlab.com/christoper.hans/glab-ci-test-branch
- Sample
.gitlab-ci.yml
returns current branch (Reference: https://gitlab.com/christoper.hans/glab-ci-test-branch/-/blob/main/.gitlab-ci.yml#L7, also see screenshot (1)) - Using this sample,
glab ci run
will result in job printing current branch name - Checkout to
test-branch
and runglab ci run
locally (screenshot (2)) - Check created pipeline at https://gitlab.com/christoper.hans/glab-ci-test-branch/-/pipelines/936264344 , resulting job shows current branch as
test-run
(screenshot (3) and (4))
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap