I've set up lintr package with GitHub Actions:
on: push: branches: - master pull_request: branches: - master name: lint jobs: lint: runs-on: macOS-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - uses: r-lib/actions/setup-r@master - uses: actions/cache@v1 with: path: ~/Library/Application Support/renv key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }} restore-keys: | ${{ runner.os }}-renv- - name: Install lintr run: install.packages("lintr") shell: Rscript {0} - name: Lint run: lintr::lint_dir(linters = lintr::with_defaults(assignment_linter = NULL, line_length_linter = NULL, spaces_left_parentheses_linter = NULL), pattern = '[.]R$|[.]Rmd') shell: Rscript {0} And formatting errors are shown as Annotations:
But, those annotations doesn't fails PR check which is actually what you want when you lint code.
I thought of setting an exit 1 on warnings. Is that the correct approach?

