-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f778046
commit f4552e3
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: run pre-commit | ||
|
||
on: | ||
repository_dispatch: | ||
types: [pre-commit-run-command] | ||
jobs: | ||
runPreCommit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
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@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: 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Slash Command Dispatch | ||
on: | ||
issue_comment: | ||
types: [created] | ||
jobs: | ||
slashCommandDispatch: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Slash Command Dispatch | ||
uses: peter-evans/slash-command-dispatch@v2 | ||
with: | ||
token: ${{ secrets.ACTION_TRIGGER_TOKEN }} | ||
issue-type: pull-request | ||
commands: | | ||
pre-commit-run |