foo-software / lighthouse-check-action

GitHub Action for running @GoogleChromeLabs Lighthouse audits with all the bells and whistles 🔔 Multiple audits, Slack notifications, and more!
https://github.com/marketplace/actions/lighthouse-check
MIT License
471 stars 24 forks source link

How does `overridesJsonFile` work? #100

Closed pmpinto closed 2 years ago

pmpinto commented 2 years ago

Describe the bug I'm pointing to a local file, under /.github/workflows, like this:

        uses: foo-software/lighthouse-check-action@master
        with:
          gitHubAccessToken: ${{ secrets.GITHUB_TOKEN }}
          urls: 'https://…'
          overridesJsonFile: ./lighthouse-overrides.json

It outputs Error: ENOENT: no such file or directory. Is there anything missing on the path itself? Or is this not how one refer to files in here?

Additional context Alternatively, I would like to use onlyCategories, but there also doesn't seem to be a way to define those in the workflow file itself, or am I missing something?

Thanks!

adamhenson commented 2 years ago

Error: ENOENT: no such file or directory.

@pmpinto this error means that file path is incorrect. It's not a bug with this GitHub Action hence closing this issue.

As noted in the documentation the code resolves the file with path.resolve.

It appears that you are incorrectly assuming that the file is resolved relative to the configuration file, while actually it's relative to the executor if the path isn't absolute (please feel free to keep me honest and correct me if my wording is wrong... I'm a little rusty).

        uses: foo-software/lighthouse-check-action@master
        with:
          gitHubAccessToken: ${{ secrets.GITHUB_TOKEN }}
          urls: 'https://…'
-          overridesJsonFile: ./lighthouse-overrides.json
+         overridesJsonFile: '.github/workflows/lighthouse-overrides.json'
adamhenson commented 2 years ago

Alternatively, I would like to use onlyCategories, but there also doesn't seem to be a way to define those in the workflow file itself, or am I missing something?

That's a correct assumption at this time.