Skip to content

Commit

Permalink
Run pre-commit against all files if PR changes lint config (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb authored Sep 25, 2024
1 parent 57358f4 commit d674138
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/get-changed-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
deleted:
- deleted:
- '**'
pre-commit:
- added|modified|deleted:
- .pre-commit-config.y?(a)ml
- name: Echo Changed Files Output
run: echo "${{ toJSON(steps.changed-files.outputs) }}"
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
pre-commit install --install-hooks
- name: Check ALL Files On Branch
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' || fromJSON(inputs.changed-files)['pre-commit'] == 'true'
run: |
pre-commit run --show-diff-on-failure --color=always --all-files
Expand Down
1 change: 1 addition & 0 deletions changelog/+prelint.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Made pre-commit run on all files in PRs that change lint config
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ jobs:
deleted:
- deleted:
- '**'
pre-commit:
- added|modified|deleted:
- .pre-commit-hooks/**
- .pre-commit-config.y?(a)ml
- .pylintrc
- pyproject.toml

- name: Echo Changed Files Output
run: echo "${{ toJSON(steps.changed-files.outputs) }}"
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
pre-commit install --install-hooks

- name: Check ALL Files On Branch
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' || fromJSON(inputs.changed-files)['pre-commit'] == 'true'
run: |
pre-commit run --show-diff-on-failure --color=always --all-files

Expand Down

0 comments on commit d674138

Please sign in to comment.