forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.26 KB
/
comment_bot.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
name: Comment-bot
on:
issue_comment:
types:
- created
- edited
jobs:
autotune:
name: "Fixup pre-commit formatting"
if: startsWith(github.event.comment.body, '@github-actions pre-commit')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache multiple paths
uses: actions/cache@v2
with:
path: |
~/.cache/pre-commit
~/.cache/pip
key: pre-commit-dispatched-${{ runner.os }}-build
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install-pre-commit
run: python -m pip install --upgrade pre-commit
- name: Run pre-commit
run: pre-commit run --from-ref=origin/master --to-ref=HEAD --all-files || (exit 0)
- name: Commit results
run: |
git config user.name "$(git log -1 --pretty=format:%an)"
git config user.email "$(git log -1 --pretty=format:%ae)"
git commit -a -m 'Fixes from pre-commit [automated commit]' || echo "No changes to commit"
- uses: r-lib/actions/pr-push@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}