Skip to content

Commit 5cbe306

Browse files
committed
Merge branch 'ci/pre-commit-update'
2 parents d47771f + 5dde912 commit 5cbe306

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/pre-commit.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
branches:
77
- master
88
pull_request:
9-
types: [opened, reopened, synchronize, labeled, unlabeled]
9+
types: [opened, reopened, synchronize, labeled]
1010

1111
concurrency:
1212
group: pre-commit-${{github.event.pull_request.number || github.ref}}
@@ -15,8 +15,10 @@ concurrency:
1515
jobs:
1616
lint:
1717
if: |
18-
contains(github.event.pull_request.labels.*.name, 'Status: Pending Merge') ||
19-
github.event_name != 'pull_request'
18+
github.event_name != 'pull_request' ||
19+
(github.event.action != 'labeled' &&
20+
(github.event.label.name == 'Status: Pending Merge' || github.event.label.name == 'Re-trigger Pre-commit Hooks'))
21+
2022
name: Check if fixes are needed
2123
runs-on: ubuntu-latest
2224
steps:
@@ -25,6 +27,12 @@ jobs:
2527
with:
2628
fetch-depth: 2
2729

30+
- name: Remove Label
31+
if: github.event.action == 'labeled' && github.event.label.name == 'Re-trigger Pre-commit Hooks'
32+
run: gh pr edit ${{ github.event.number }} --remove-label 'Re-trigger Pre-commit Hooks'
33+
env:
34+
GH_TOKEN: ${{ github.token }}
35+
2836
- name: Set up Python 3
2937
uses: actions/setup-python@v5
3038
with:
@@ -65,7 +73,7 @@ jobs:
6573
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
6674

6775
- name: Push changes using pre-commit-ci-lite
68-
uses: pre-commit-ci/lite-action@v1.0.2
76+
uses: pre-commit-ci/lite-action@v1.1.0
6977
# Only push changes in PRs
7078
if: ${{ always() && github.event_name == 'pull_request' }}
7179
with:

tools/pre-commit/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pre-commit==3.7.1
1+
pre-commit==4.0.1
22
docutils==0.16

0 commit comments

Comments
 (0)