Rubocop Linter Action is a GitHub Action to run Rubocop against your Ruby codebase and output the results in the GitHub Checks UI.
If you are submitting an issue, please use our reproduction template.
This GitHub Action provides a way to easily run Rubocop on your Ruby or Ruby on Rails project. While it is possible to write a custom GitHub Action to run Rubocop on your codebase, this action takes that functionality one step further using the Checks API. After the Rubocop Linter Action runs Rubocop against your Ruby code, it will create annotations that you can easily view in the GitHub UI, matched up with the offending code.
Since GitHub Actions and the Checks API are continually changing, it is possible that there will be breaking API changes that affect this action. If so, please open an issue and we will look into it as soon as we can. Thank you for using this project! ❤️
Please view the official documentation for more detailed instructions, including how to setup and use a configuration file to customize the action. Note that you can set the version for the documentation you are viewing in the bottom right.
NOTE: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.
This is straight out of GitHub's documentation. Put simply, this action won't work correctly on pull requests from a forked repository as is. I am open to a PR that will just output the results of the RuboCop run to the actions log if someone would like to take a shot at adding that!
Default usage, similar to running gem install rubocop && rubocop
from your command line:
- name: Rubocop Linter Action
uses: andrewmcodes/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!