Skip to content

Commit bfa05f8

Browse files
authored
[CI] Switch pre-commit to use ASF approved prek-action (apache#1318)
1 parent f7b3913 commit bfa05f8

1 file changed

Lines changed: 4 additions & 20 deletions

File tree

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
---
19+
# https://github.com/j178/prek
1820
name: pre-commit
1921

2022
on: [pull_request]
2123

2224
permissions:
2325
contents: read
2426

25-
concurrency:
26-
group: ${{ github.workflow }}-${{ github.ref }}
27-
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
28-
2927
jobs:
3028
pre-commit:
3129
name: Run pre-commit
@@ -35,20 +33,6 @@ jobs:
3533
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3634
with:
3735
persist-credentials: false
38-
- name: Setup Python
39-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
40-
with:
41-
python-version: '3.13'
42-
architecture: 'x64'
43-
- name: Install dependencies
44-
run: |
45-
python -m pip install --upgrade pip
46-
pip install pre-commit
47-
- name: set PY
48-
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV"
49-
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
36+
- uses: j178/prek-action@bdca6f102f98e2b4c7029491a53dfd366469e33d # v2.0.4
5037
with:
51-
path: ~/.cache/pre-commit
52-
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
53-
- name: Run pre-commit
54-
run: pre-commit run --all-files
38+
extra-args: --all-files

0 commit comments

Comments
 (0)