forked from saltstack/salt-winrepo-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (36 loc) · 1.16 KB
/
pre-commit.yml
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Pre-Commit
on: [push, pull_request]
jobs:
Pre-Commit:
name: Run Pre-Commit
runs-on: ubuntu-latest
container:
image: python:3.8.6-slim-buster
steps:
- name: Install System Deps
run: |
apt-get update
apt-get install -y git libcurl4-openssl-dev gcc libssl-dev libmagic1
- uses: actions/checkout@v2
- name: Set Pre-Commit Cache Key
run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Setup Pre-Commit Cache
uses: pat-s/[email protected]
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- id: changed-files
name: Get Changed Files
uses: dorny/paths-filter@v2
with:
token: ${{ github.token }}
list-files: json
filters: |
repo:
- added|modified:
- '**'
- name: Check Changed Files
uses: pre-commit/[email protected]
if: steps.changed-files.outputs.repo == 'true'
with:
extra_args: --verbose --files ${{ join(fromJSON(steps.changed-files.outputs.repo_files), ' ') }}