Skip to content

Latest commit

 

History

History
66 lines (55 loc) · 1.74 KB

File metadata and controls

66 lines (55 loc) · 1.74 KB

This workflow automatically validates pull request titles, commit messages, and labels against conventional commit standards. .github/workflows/pr-checks.yml

Overview

Automatically validates:

  • PR titles follow conventional commit format
  • Commit messages follow conventional commit standards
  • Presence of at least one label on the PR
  • Supports all standard conventional commit types

Features

  • Configurable conventional commit types
  • Label requirement check (default true)
  • Customizable subject pattern (default requires uppercase start)
  • Supports WIP PRs
  • Validates single commit messages when enabled
  • Comprehensive error messages for validation failures

Usage

This workflow triggers automatically on PR events and can be configured with input parameters.

Example Implementation

name: 'PR Validation'

on:
  pull_request_target:
    types:
      - opened
      - edited
      - synchronize
      - reopened

jobs:
  pr-validation:
    uses: clouddrove/github-shared-workflows/.github/workflows/pr-checks.yml@master
    secrets: inherit
    with:
      types: |
        fix
        feat
        docs
        ci
        chore
        test
        refactor
        style
        perf
        build
        revert
      checkLabels: true  # Set to false to disable label checking

Optional Configuration

    with:
      requireScope: false  # Whether to require scope in commit messages
      subjectPattern: '^[A-Z].+$'  # Regex pattern for subject validation
      validateSingleCommit: false  # Validate single commit message only
      checkLabels: true  # Whether to check for PR labels