-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) · 1.63 KB
/
pre-commit-2.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
48
49
50
51
52
53
54
55
name: pre-commit-2
on:
pull_request:
branches: [master]
types: [opened, synchronize, closed]
push:
branches: [master]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v3
# https://github.com/actions/setup-python
- uses: actions/setup-python@v4
with:
python-version: '3.7'
# https://github.com/trilom/file-changes-action
# https://github.com/pre-commit/action/issues/7#issuecomment-669149713
# https://github.com/pre-commit/action/issues/7#issuecomment-884570441
- id: file_changes
uses: trilom/file-changes-action@v1.2.4
with:
output: 'space'
- name: Show File Changes
run: |
echo -e 'files.json'
cat $HOME/files.json
echo -e '\nfiles_modified.json\n'
cat $HOME/files_modified.json
echo -e '\nfiles_added.json'
cat $HOME/files_added.json
echo 'files_removed.json'
cat $HOME/files_removed.json
echo '${{ steps.file_changes.outputs.files }}'
echo '${{ steps.file_changes.outputs.files_modified }}'
echo '${{ steps.file_changes.outputs.files_added }}'
echo '${{ steps.file_changes.outputs.files_removed }}'
- name: steps.file_changes.outputs.files
run: |
echo '${{ steps.file_changes.outputs.files }}'
# https://github.com/marketplace/actions/pre-commit
# https://github.com/cloudposse/github-action-pre-commit
- uses: pre-commit/action@v3.0.0
with:
extra_args: --files ${{ steps.file_changes.outputs.files }}
# https://github.com/pre-commit/action/issues/7