Skip to content

Commit d0b2d87

Browse files
authored
Merge pull request #97 from cadenmyers13/precommit
Add pre-commit to .github/workflow
2 parents fe9c741 + e20e5e2 commit d0b2d87

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/pre-commit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
pre-commit:
10+
# pull requests are a duplicate of a branch push if within the same repo.
11+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
12+
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v4
17+
- name: Make prevent_commit_to_main.sh executable
18+
run: chmod +x ./prevent_commit_to_main.sh
19+
- uses: pre-commit/action@v3.0.0
20+
with:
21+
extra_args: --all-files

0 commit comments

Comments
 (0)