Skip to content

Commit

Permalink
feat: add CI pipelines to enforce proper pull request titles (#558)
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Klick <[email protected]>
  • Loading branch information
nathanklick authored Nov 15, 2023
1 parent 73f7c1b commit 674ac32
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/flow-pull-request-formatting.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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 ]

0 comments on commit 674ac32

Please sign in to comment.