Adapt GitHub Actions workflows for self-hosted Gitea instance: - CI workflow with PlatformIO build, cppcheck, and clang-format - PR title format checker using conventional commits - Release workflow for tagged builds Keeps original .github/workflows/ for upstream compatibility.
This commit is contained in:
40
.gitea/workflows/pr-formatting-check.yml
Normal file
40
.gitea/workflows/pr-formatting-check.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
name: "PR Formatting"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- reopened
|
||||
- edited
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
title-check:
|
||||
name: Title Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check PR Title Format
|
||||
run: |
|
||||
PR_TITLE="${{ github.event.pull_request.title }}"
|
||||
echo "Checking PR title: $PR_TITLE"
|
||||
|
||||
# Conventional commit pattern: type(scope): description or type: description
|
||||
# Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
|
||||
PATTERN="^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([a-zA-Z0-9_-]+\))?: .+"
|
||||
|
||||
if echo "$PR_TITLE" | grep -qE "$PATTERN"; then
|
||||
echo "✓ PR title follows conventional commit format"
|
||||
else
|
||||
echo "✗ PR title does not follow conventional commit format"
|
||||
echo ""
|
||||
echo "Expected format: type(scope): description"
|
||||
echo " or: type: description"
|
||||
echo ""
|
||||
echo "Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " feat(reader): add bookmark sync feature"
|
||||
echo " fix: resolve memory leak in epub parser"
|
||||
echo " docs: update README with new instructions"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user