Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

It runs ruff against pull requests changed lines, and creates a review comment with them.

Notifications You must be signed in to change notification settings

EnriqueSoria/annotate_pr_with_ruff

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Warning

Archived because now ruff does this by default. Check its docs: https://docs.astral.sh/ruff/integrations/#github-actions

Annotate pull requests with ruff

It runs ruff against pull requests changed lines, and creates a review comment with them.

Configuration

name: 'Dependency Review'
on: [pull_request]

jobs:
  dependency-review:
    runs-on: ubuntu-latest
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so that annotate_pr_with_ruff can access it.
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.10' 
      - name: Install dependencies library
        run: |
          pip install ruff
        shell: bash
      - name: annotate_pr_with_ruff
        uses: EnriqueSoria/annotate_pr_with_ruff@c226a0b09f7e8ea7f148f29c129f89399b37f03d
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

For the installation of ruff there are two options possible:

      - name: Install ruff from install-pinned action
        uses: install-pinned/ruff@66c987de12929f701b73e83c82edc36050ae55a0  # Specify a version
  • Using pip without specifying a version, which will ensure you have always the same version
      - name: Install ruff from pypi
        run: |
          pip install ruff

Images

Here's an screenshot of what it can do:

imagen

Credits

I've used typilus/typilus-action as a template for creating this action, which is MIT Licensed.