.forgejo: Add pre-commit action #1119
2 changed files with 26 additions and 1 deletions
25
.forgejo/workflows/pre-commit.yml
Normal file
25
.forgejo/workflows/pre-commit.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
name: Pre-commit hooks
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
precommit:
|
||||
name: Pre-commit
|
||||
env:
|
||||
# Skip pre-commit hooks which are executed by other actions.
|
||||
SKIP: make-lint,go-staticcheck-repo-mod,go-unit-tests,gofumpt
|
||||
runs-on: ubuntu-22.04
|
||||
# If we use actions/setup-python from either Github or Gitea,
|
||||
# the line above fails with a cryptic error about not being able to found python.
|
||||
# So install everything manually.
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version: 1.22
|
||||
- name: Set up Python
|
||||
run: |
|
||||
apt update
|
||||
apt install -y pre-commit
|
||||
- name: Run pre-commit
|
||||
run: pre-commit run --color=always --hook-stage manual --all-files
|
Loading…
Reference in a new issue