3 screenshots to explain the issue
When I run the pipeline I've an error...
But the file exists
And it's good
.gitlab-ci.yml
file.gitlab-ci.yml
file location (Settings > CI/CD > General Pipelines), make sure that it points to the correct place in the repositoryIt happened to me also when I was specifying the .gitlab-ci.yml in a .yAml format, I am not exactly sure why this happens. I have tried to understand the difference between the two reading this question but it seems there should be no differences. I lost 30 min because of this, hope I can save someone else time.
In my case, I incorrectly assumed that glab
would run a pipeline for the current branch.
I was running glab cli run
on branch-1
which did have a .gitlab-ci.yml
. But it was trying to run a pipeline for master
, which didn't have a .gitlab-ci.yml
.
glab cli run -b branch-1
fixed it for me.
Just found this by googling the same issue. The answers listed here didn't help, so I thought it's worth adding what was wrong in my case.
The culprit was the leading whitespace accidentally copy-pasted into the file name. That is, I had .gitlab-ci.yml
instead of .gitlab-ci.yml
.
During investigation I realized that there was an indication that something is wrong with the file name after all. It was the icon next to the file name, which corresponds to a regular YAML file, not a GitLab CI pipeline configuration:
This eventually helped looking into the right direction.
© 2022 - 2024 — McMap. All rights reserved.
qa
the default branch in the repo? There is an issue (although closed) gitlab.com/gitlab-org/gitlab-foss/-/issues/43266, probably it's somehow related. – Nomenclature