SchemaStore/schemastore

gitlab-ci files are not recognized, if they live under `.gitlab/ci`

Opened this issue · 2 comments

Area with issue?

JSON Schema

✔️ Expected Behavior

To break the gitlab ci configuration into smaller files it is possible to put them into the folder .gitlab/ci. Then you can include these files in the .gitlab-ci.yml file, which is lying in the root dir of the project.
This makes it easy to work with complex pipelines.
In catalog.json you could expand the fileMatch argument with the following parameters:
"**.gitlab/ci/*.yml", "**.gitlab/ci/*.yaml"
This would be great, so you could organize the files as the stages or jobs they represent.

❌ Actual Behavior

If i place a gitlab-ci file, which has something to do with docker images under .gitlab/ci and name it docker.yml it will result in the following file path: .gitlab/ci/docker.yml.
Although it is a valid gitlab-ci file, the fileMatch regex is not satisfied and therefore the correct schema could not be selected.

YAML or JSON file that does not work.

Any otherwise correct .gitlab-ci.yml file under the dir $PROJECT_ROOT/.gitlab/ci

IDE or code editor.

None

Are you making a PR for this?

Yes, I will create a PR.

Edit: changed link to correct position and corrected fileMatch pattern

Somehow my link was linking to the wrong section.
Here is the correct link

"name": "gitlab-ci",

"name": "gitlab-ci",
      "description": "GitLab CI Configuration file",
      "fileMatch": [
        "**/.gitlab-ci.yml",
        "**/.gitlab-ci.yaml",
        "**/*.gitlab-ci.yml",
        "**/*.gitlab-ci.yaml"
      ],

You could do something like

"name": "gitlab-ci",
      "description": "GitLab CI Configuration file",
      "fileMatch": [
        "**/.gitlab-ci.yml",
        "**/.gitlab-ci.yaml",
        "**/.gitlab/ci/*.yml",
        "**/.gitlab/ci/*.yaml,
        "**/*.gitlab-ci.yml",
        "**/*.gitlab-ci.yaml",
      ],

which shouldn't result in a filematch conflict

Thanks for the report - related to #1783