diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 80da2c0c6..6d1790c6b 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -160,7 +160,7 @@ description: 'Validate GitLab CI config against the schema provided by SchemaStore' entry: check-jsonschema --builtin-schema vendor.gitlab-ci --data-transform gitlab-ci --regex-variant nonunicode language: python - files: ^.*\.gitlab-ci\.yml$ + files: ^.*\.gitlab-ci\.(yml|yaml)$ types: [yaml] # this hook is autogenerated from a script diff --git a/src/check_jsonschema/catalog.py b/src/check_jsonschema/catalog.py index f98ceb6b2..0a59c1e9d 100644 --- a/src/check_jsonschema/catalog.py +++ b/src/check_jsonschema/catalog.py @@ -162,7 +162,7 @@ def _githubusercontent_url(owner: str, repo: str, ref: str, path: str) -> str: "--regex-variant", "nonunicode", ], - "files": r"^.*\.gitlab-ci\.yml$", + "files": r"^.*\.gitlab-ci\.(yml|yaml)$", "types": "yaml", }, }, diff --git a/tests/acceptance/test_hook_file_matches.py b/tests/acceptance/test_hook_file_matches.py index 918ed315b..bc9403848 100644 --- a/tests/acceptance/test_hook_file_matches.py +++ b/tests/acceptance/test_hook_file_matches.py @@ -138,9 +138,9 @@ def get_hook_config(hookid): ".gitlab-ci.yml", ".gitlab/.gitlab-ci.yml", "gitlab/.gitlab-ci.yml", + ".gitlab-ci.yaml", ), "bad": ( - ".gitlab-ci.yaml", "gitlab-ci.yml", ".gitlab/gitlab-ci.yml", "gitlab/gitlab-ci.yml",