Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Report ESLint reports on a Pull Request via Checks API #76

Closed
stefanbuck opened this issue Aug 9, 2018 · 4 comments
Closed

Idea: Report ESLint reports on a Pull Request via Checks API #76

stefanbuck opened this issue Aug 9, 2018 · 4 comments

Comments

@stefanbuck
Copy link

Idea – I want to build an app which uses the checks API to report ESLint issues from and potentially from others back on a Pull Request. First of all, do you know if this exist already?

Anyway, I played around with the checks API and was able to create checks for a hard-coded fixture. Now I want to use real reports coming from a Pull Request. I was thinking something similar to codecov which uploads reports from a CI to codecov.io and this is where I currently stuck.

In my current implementation I listen to pull_request.synchronize which allows me to use context.github. I added a new express route /upload which will receive uploading reports from the CI which leads me to two questions

  1. How can I access github.checks.create within the /upload handler? Do I have to create a new octokit/rest instance?
  2. How to match reliable an uploaded report with the related PullRequest? I guess sending the PR-URL form the CI isn't a good indicator and not very save. I thought about using a token to verify that a repo owner is sending this report, but today I saw that codecov don't need this for public repositories and I wonder how they do it.
@JasonEtco
Copy link
Member

JasonEtco commented Aug 9, 2018

This isn't exactly what you've described, but its pretty close: https://github.com/koddsson/eslint-disable-probot

The only difference is that it points out when ESLint rules have been disabled, rather than when they've failed.

GitHub
eslint-disable-probot - A bot that comments on PRs that try to disable certain eslint rules

@stefanbuck
Copy link
Author

This looks cool, but it's not really close to my scenario. This app operates on the patch, whereas my app needs to wait for a third party service to upload additional information to complete the job.

@rethab
Copy link

rethab commented Aug 10, 2021

This is a typical thing for GitHub Actions and several already exist: https://github.com/marketplace?type=&verification=&query=eslint

@stefanbuck
Copy link
Author

Back then GitHub Actions wasn't a thing, but I'm more than happy to close this request now. GitHub Actions are just 🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants