json-yaml-validate icon indicating copy to clipboard operation
json-yaml-validate copied to clipboard

Syntax error on negation in gitignore

Open fatbasstard opened this issue 9 months ago • 0 comments

We've got the following line in .gitignore:

!functions/**/local.env

This results in the following Syntax error:

Run GrantBirki/[email protected]
  with:
    github_token: ***
    mode: fail
    comment: false
    base_dir: .
    use_dot_match: true
    json_schema_version: draft-07
    json_extension: .json
    use_ajv_formats: true
    yaml_extension: .yaml
    yaml_extension_short: .yml
    yaml_as_json: false
    use_gitignore: true
    git_ignore_path: .gitignore
    allow_multiple_documents: false
    ajv_strict_mode: true

/home/runner/work/_actions/GrantBirki/json-yaml-validate/v[2](https://github.com/xxx/xxx/actions/runs/9063058018/job/24898214270?pr=163#step:3:2).7.1/src/functions/exclude.js:77
        const regex = new RegExp(pattern.replace(/^!/, ''))
^
SyntaxError: Invalid regular expression: /functions/**/local.env/: Nothing to repeat
    at new RegExp (<anonymous>)
    at Exclude.isExcluded (/home/runner/work/_actions/GrantBirki/json-yaml-validate/v2.[7](https://github.com/xxx/xxx/actions/runs/9063058018/job/24898214270?pr=163#step:3:7).1/src/functions/exclude.js:77:1)
    at yamlValidator (/home/runner/work/_actions/GrantBirki/json-yaml-validate/v2.7.1/src/functions/yaml-validator.js:90:1)
    at run (/home/runner/work/_actions/GrantBirki/json-yaml-validate/v2.7.1/src/main.js:[8](https://github.com/xxx/xxx/actions/runs/9063058018/job/24898214270?pr=163#step:3:8):1)
    ```

fatbasstard avatar May 13 '24 12:05 fatbasstard