Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Included file does not have a valid YAML syntax

I am including a remote .gitlab-ci.yml file

variables:
   ENTITY_NAME: $CI_PROJECT_TITLE

include:
   remote: 'https://gitlab.com/paulblart/paul_test/-/main/.gitlab-ci.yml'

but checking for it YAML syntax in CI Lint GUI its saying

Included file 'https://gitlab.com/paulblart/paul_test/-/main/.gitlab-ci.yml' does not have valid YAML syntax!

But upon checking the syntax of .gitlab-ci.yml of the remote file its valid. I am not sure whats going on.

like image 819
Paul Blart Avatar asked Oct 20 '25 10:10

Paul Blart


2 Answers

I have workaround for this issue

include:
   - project: "my-project-with-yml/project-name"
     ref: master
     file: "/yml/.gitlab-ci.yaml"
     rules: ## Optional, to show the support to **rules**
     - if: $variable == "condition "

I was also facing the issue with YAML Error, even though the lint was green.

like image 123
Sudarshan Gaikwad Avatar answered Oct 22 '25 04:10

Sudarshan Gaikwad


I saw a different version of problem in my case, I was trying to set CI/CD configuration file pointing to a different project with relatively longer name of a valid yaml file. I checked the linting, file was yaml but error thrown while attempting to run the pipeline was: Included file .gitlab-ci-a-very-long-gilabci-file.yml@group/subgroup/pipeline-project does not have YAML extension!

Shortening the name solved it, Gitlab can improve the error messages. Just adding as I didn't find it on Stackoverflow.

like image 45
ashish bustler Avatar answered Oct 22 '25 04:10

ashish bustler