From 17c09d17e0776fcc813ac2e8c860b91f6bda9e27 Mon Sep 17 00:00:00 2001 From: Kondal Kolipaka Date: Tue, 5 Sep 2023 15:57:52 +0530 Subject: [PATCH] ci: Add conventional-precommit-linter on pull_request --- .github/workflows/pre-commit.yml | 24 ++++++++++++++++++++++++ .pre-commit-config.yaml | 12 ++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 000000000..3741f50ae --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,24 @@ +name: Precommit Hook + +on: + pull_request: + branches: [ master ] + +jobs: + precommit: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install pre-commit + run: pip install pre-commit + + - name: Run pre-commit hook + run: pre-commit run --all-files \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..3e925ad63 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +--- + minimum_pre_commit_version: 3.3.0 + default_install_hook_types: [pre-commit, commit-msg] + + repos: + - repo: https://github.com/espressif/conventional-precommit-linter + rev: v1.2.1 + hooks: + - id: conventional-precommit-linter + stages: [commit-msg] \ No newline at end of file