Skip to content

v8r failing due to megalinter not executing within project path #1875

@estahn

Description

@estahn

Describe the bug

I created a file .github/workflows/deploy.yml. Running megalinter in GitHub Actions will produce an error as v8r detects a schema which is incorrect.

v8r uses the following schemastore file to detect the required schema (https://github.com/SchemaStore/schemastore/blob/2e3b50930f40c237d0070414701ea7c44ca2c85e/src/api/json/catalog.json#L1073-L1078). Within this file an attribute fileMatch will be used to detect the schema based on the file path. MegaLinter does not pass a relative path (it will pass /github/workspace/.github/workflows/deploy.yml) hence the match will match with the wrong result.

This may or may not be an issue with v8r, schemastore or megalinter. I'm open for suggestions where to place this.

To Reproduce
Steps to reproduce the behavior:

  1. Create project dir and file called mkdir -p v8r-test/.github/workflows && touch v8r-test/.github/workflows/deploy.yml
  2. Run v8r from within project dir cd v8r-test && npx v8r@latest .github/workflows/deploy.yml --verbose
  3. Run v8r from outside the project dir cd .. && npx v8r@latest .github/workflows/deploy.yml --verbose
  4. See different results

Expected behavior
Step 2 and 3 should behave the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O: stale 🤖This issue or pull request is stale, it will be closed if there is no activitybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions