Skip to content

ENOENT: no such file or directory when host contains protocol #5

@WtfJoke

Description

@WtfJoke

ENOENT: no such file or directory, open '/home/runner/work/project/project/output/undefined'

If you pass a domain with protocol e.g https://example.com (instead of example.com) the report file cannot be found.

Example (non working):

- uses: mbogh/test-ssl-action@v2
  with:
    host: https://example.com

Example (working):

- uses: mbogh/test-ssl-action@v2
  with:
    host: example.com

The cause is, that the report is generated without the protocol eg. example.com...json

The issue is most likely on this line (a potential fix, either validate host or change startsWith to contains):

let reportFile = fs.readdirSync(path).filter(fn => fn.startsWith(host) && fn.endsWith('.json'))[0];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions