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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With