Skip to content

Update PR #4 description to highlight reply targeting fix #24

Update PR #4 description to highlight reply targeting fix

Update PR #4 description to highlight reply targeting fix #24

Workflow file for this run

name: PR Checks
on:
pull_request:
types: [opened, reopened, synchronize, edited]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request;
const errors = [];
const warnings = [];
if (pr.title.length < 10) {
errors.push('❌ PR title too short (minimum 10 characters)');
}
if (!/^(feat|fix|docs|style|refactor|test|chore|perf|ci|build|revert)(\(.+\))?:/.test(pr.title)) {
warnings.push('⚠️ PR title should follow conventional commits format');
}
if (!pr.body || pr.body.length < 20) {
errors.push('❌ PR description is required (minimum 20 characters)');
}
const totalChanges = (pr.additions || 0) + (pr.deletions || 0);
if (totalChanges > 500) {
warnings.push(`⚠️ Large PR detected (${totalChanges} lines changed)`);
}
const allMessages = [...errors, ...warnings];
if (allMessages.length > 0) {
const comment = `## 🔍 PR Validation\n\n${allMessages.join('\n')}`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr.number,
body: comment
});
if (errors.length > 0) {
core.setFailed('PR validation failed');
}
}