Skip to content

Commit 22c2057

Browse files
committed
ci(pre-commit): Bump versions and add label re-trigger
1 parent d47771f commit 22c2057

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.github/workflows/pre-commit.yml

Lines changed: 13 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,11 @@ 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' ||
21+
github.event.label.name == 'Re-trigger Pre-commit Hooks'
22+
2023
name: Check if fixes are needed
2124
runs-on: ubuntu-latest
2225
steps:
@@ -25,6 +28,12 @@ jobs:
2528
with:
2629
fetch-depth: 2
2730

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

6776
- name: Push changes using pre-commit-ci-lite
68-
uses: pre-commit-ci/lite-action@v1.0.2
77+
uses: pre-commit-ci/lite-action@v1.1.0
6978
# Only push changes in PRs
7079
if: ${{ always() && github.event_name == 'pull_request' }}
7180
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)