Skip to content

Commit

Permalink
Merge branch 'ci/pre-commit-update'
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Oct 29, 2024
2 parents d47771f + 22c2057 commit e615f69
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches:
- master
pull_request:
types: [opened, reopened, synchronize, labeled, unlabeled]
types: [opened, reopened, synchronize, labeled]

concurrency:
group: pre-commit-${{github.event.pull_request.number || github.ref}}
Expand All @@ -15,8 +15,11 @@ concurrency:
jobs:
lint:
if: |
contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') ||
github.event_name != 'pull_request'
github.event_name != 'pull_request' ||
github.event.action != 'labeled' ||
github.event.label.name == 'Status: Pending Merge' ||
github.event.label.name == 'Re-trigger Pre-commit Hooks'
name: Check if fixes are needed
runs-on: ubuntu-latest
steps:
Expand All @@ -25,6 +28,12 @@ jobs:
with:
fetch-depth: 2

- name: Remove Label
if: github.event.action == 'labeled' && github.event.label.name == 'Re-trigger Pre-commit Hooks'
run: gh pr edit ${{ github.event.number }} --remove-label 'Re-trigger Pre-commit Hooks'
env:
GH_TOKEN: ${{ github.token }}

- name: Set up Python 3
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -65,7 +74,7 @@ jobs:
key: ${{ steps.restore-cache.outputs.cache-primary-key }}

- name: Push changes using pre-commit-ci-lite
uses: pre-commit-ci/lite-action@v1.0.2
uses: pre-commit-ci/lite-action@v1.1.0
# Only push changes in PRs
if: ${{ always() && github.event_name == 'pull_request' }}
with:
Expand Down
2 changes: 1 addition & 1 deletion tools/pre-commit/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pre-commit==3.7.1
pre-commit==4.0.1
docutils==0.16

0 comments on commit e615f69

Please sign in to comment.