From 58573a97d0f35bd03182a464579d3e967685db71 Mon Sep 17 00:00:00 2001 From: Lukas Zapletal Date: Tue, 7 Nov 2023 09:32:46 +0100 Subject: [PATCH] chore: add pre-commit action Signed-off-by: Lukas Zapletal --- .github/workflows/gotest.yml | 20 ++++++++++++++------ .pre-commit-config.yaml | 12 ++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/gotest.yml b/.github/workflows/gotest.yml index 480b3a07..ff3ac07a 100644 --- a/.github/workflows/gotest.yml +++ b/.github/workflows/gotest.yml @@ -13,7 +13,7 @@ env: jobs: commit: - name: "💾 Commit message" + name: "💬 Commit message" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -30,8 +30,16 @@ jobs: make check-commits working-directory: code + precommit: + name: "📚 Commit checks" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 + build: - name: "🛠️ Go Build" + name: "🛠 Go Build" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -44,7 +52,7 @@ jobs: make check-system-go build GO=go lint: - name: "🎯 Code format & OpenAPI lint" + name: "🏢 Code format & OpenAPI lint" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -67,7 +75,7 @@ jobs: make check-system-go check-fmt validate GO=go golint: - name: "🎯 Go linter" + name: "🏫 Go linter" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -82,7 +90,7 @@ jobs: version: v1.53.3 testing: - name: "📎 Unit tests" + name: "🏅 Unit tests" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -96,7 +104,7 @@ jobs: make check-system-go test GO=go test-dao: - name: "🗄 Integration tests" + name: "🏆 Integration tests" runs-on: ubuntu-latest services: postgres: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..6ef2bcb7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: + - repo: https://github.com/gitleaks/gitleaks + rev: v8.16.1 + hooks: + - id: gitleaks + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-json