fix: Improve plugin logging and add test/coverage CI #30
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR Title | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - edited | |
| - reopened | |
| - synchronize | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| concurrency: | |
| group: pr-title-${{ github.workflow }}-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| conventional-pr-title: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Validate PR title | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: | | |
| python3 - <<'PY' | |
| import os | |
| import re | |
| import sys | |
| title = os.environ["PR_TITLE"] | |
| pattern = re.compile( | |
| r"^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([^)]+\))?(!)?: .+" | |
| ) | |
| if pattern.match(title): | |
| print("PR title is a valid conventional commit title.") | |
| raise SystemExit(0) | |
| print(f"Invalid PR title: {title}", file=sys.stderr) | |
| print("Expected format: type(scope): description", file=sys.stderr) | |
| print( | |
| "Allowed types: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test", | |
| file=sys.stderr, | |
| ) | |
| raise SystemExit(1) | |
| PY |