Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/formatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,27 @@ jobs:
runs-on: [ubuntu-latest]
steps:
- name: Checkout PR head
uses: actions/checkout@v3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name == 'pull_request'
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: github.event_name == 'workflow_dispatch'

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v46.0.1
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
with:
files: |
**/*.py

# This is used for forked PRs as write permissions are required to format files
- name: Run and commit changes with `ruff format .` locally on your forked branch to fix errors if they appear
if: ${{ github.event.pull_request.head.repo.fork == true and steps.changed-files.outputs.all_changed_files != '' }}
uses: chartboost/ruff-action@v1
if: ${{ github.event.pull_request.head.repo.fork == true && steps.changed-files.outputs.all_changed_files != '' }}
uses: chartboost/ruff-action@e18ae971ccee1b2d7bbef113930f00c670b78da4 # v1.0.0
id: ruff_formatter_suggestions
with:
args: format --diff --target-version py38
Expand All @@ -40,7 +40,7 @@ jobs:
# This only runs if the PR is NOT from a forked repo
- name: Format files using ruff
if: ${{ github.event.pull_request.head.repo.fork == false }}
uses: chartboost/ruff-action@v1
uses: chartboost/ruff-action@e18ae971ccee1b2d7bbef113930f00c670b78da4 # v1.0.0
id: ruff_formatter
with:
args: format
Expand Down
Loading