-
Notifications
You must be signed in to change notification settings - Fork 4
27 lines (24 loc) · 898 Bytes
/
pre-commit.yml
File metadata and controls
27 lines (24 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# SPDX-FileCopyrightText: 2023 Veit Schiele
#
# SPDX-License-Identifier: BSD-3-Clause
name: pre-commit
on: [push, pull_request]
jobs:
pre-commit:
# External pull requests should be checked, but not our own internal pull
# requests again, as these are already checked by the push on the branch.
# Without this if condition, the checks would be performed twice, as
# internal pull requests correspond to both the push and pull_request
# events.
if:
github.event_name == 'push' ||
github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v3.0.1