-
-
Notifications
You must be signed in to change notification settings - Fork 42
39 lines (38 loc) · 1.34 KB
/
dispatch_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
name: run pre-commit
on:
repository_dispatch:
types: [pre-commit-run-command]
jobs:
runPreCommit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{github.event.client_payload.pull_request.head.repo.full_name}}
ref: ${{github.event.client_payload.pull_request.head.ref}}
token: ${{ secrets.ACTION_TRIGGER_TOKEN }}
- name: Cache multiple paths
uses: actions/cache@v4
env:
# Increase this value to reset cache if requirements.txt has not changed
CACHE_NUMBER: 0
with:
path: |
~/.cache/pip
$RUNNER_TOOL_CACHE/Python/*
~\AppData\Local\pip\Cache
~/.cache/pre-commit
key: ${{ runner.os }}-build-${{ matrix.python-version }}-${{
hashFiles('.pre-commit-config.yaml') }}
- uses: actions/setup-python@v4
with:
python-version: 3.8
- name: install-pre-commit
run: python -m pip install --upgrade pre-commit
- name: Slash Command Dispatch
run: pre-commit run --all-files || (exit 0)
- run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Run pre-commit" -a
git push