diff --git a/.github/workflows/flow-pull-request-formatting.yaml b/.github/workflows/flow-pull-request-formatting.yaml new file mode 100644 index 000000000..1ccdac232 --- /dev/null +++ b/.github/workflows/flow-pull-request-formatting.yaml @@ -0,0 +1,46 @@ +## +# Copyright (C) 2023 Hedera Hashgraph, LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +## + +name: "PR Formatting" +on: + workflow_dispatch: + pull_request: + types: + - opened + - reopened + - edited + - synchronize + +defaults: + run: + shell: bash + +permissions: + statuses: write + +concurrency: + group: pr-formatting-${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + title-check: + name: Title Check + runs-on: [self-hosted, Linux, medium, ephemeral] + steps: + - name: Check PR Title + uses: aslafy-z/conventional-pr-title-action@2ce59b07f86bd51b521dd088f0acfb0d7fdac55e # v3.1.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..1d0c0ea63 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - id: check-merge-conflict + - id: detect-private-key + - id: forbid-new-submodules + - repo: https://github.com/jguttman94/pre-commit-gradle + rev: v0.3.0 + hooks: + - id: gradle-task + args: ['-w', '-o', 'spotlessApply'] + - repo: https://github.com/compilerla/conventional-pre-commit + rev: v2.4.0 + hooks: + - id: conventional-pre-commit + stages: [ commit-msg ]