Update PR #4 description to highlight reply targeting fix #24
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 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'); | |
| } | |
| } |