Skip to content

Commit 76b16bd

Browse files
committed
Add action to run precommit on pushes
1 parent 9a9e29b commit 76b16bd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/precommit.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Pre-commit
2+
3+
on:
4+
push:
5+
6+
# Declare default permissions as write only.
7+
permissions: read-all
8+
9+
# If another push to the same PR or branch happens while this workflow is still running,
10+
# cancel the earlier run in favor of the next run.
11+
#
12+
# There's no point in testing an outdated version of the code. GitHub only allows
13+
# a limited number of job runners to be active at the same time, so it's better to cancel
14+
# pointless jobs early so that more useful jobs can run sooner.
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
main:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
24+
with:
25+
submodules: false
26+
- uses: actions/setup-python@v4
27+
with:
28+
python-version: 3.x
29+
- uses: pre-commit/[email protected]
30+
- uses: pre-commit-ci/[email protected]
31+
if: always()

0 commit comments

Comments
 (0)